Skip to content

Fix APIDiff test suite #3593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2021
Merged

Fix APIDiff test suite #3593

merged 2 commits into from
Jul 12, 2021

Conversation

owenv
Copy link
Contributor

@owenv owenv commented Jul 3, 2021

Reenable the APIDiff tests

Motivation:

Reenable the APIDiff tests

Modifications:

  • Check supported frontend flags to determine if a toolchain is compatible.

Result:

APIDiff tests should pass or be skipped instead of failing with toolchains from 2021-05-14 - 2021-06-28

@owenv
Copy link
Contributor Author

owenv commented Jul 3, 2021

swiftlang/swift#38245
@swift-ci smoke test

@owenv
Copy link
Contributor Author

owenv commented Jul 3, 2021

@swift-ci smoke test

@owenv owenv marked this pull request as ready for review July 3, 2021 18:54
@@ -259,7 +259,7 @@ let package = Package(
dependencies: ["Build", "SPMTestSupport"]),
.testTarget(
name: "CommandsTests",
dependencies: ["swift-build", "swift-package", "swift-test", "swift-run", "Commands", "Workspace", "SPMTestSupport"]),
dependencies: ["swift-build", "swift-package", "swift-test", "swift-run", "Commands", "Workspace", "SPMTestSupport", "Build"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the same dependency we ran into trouble with before, where running the unit tests for even libSwiftPMDataModel will now need Build and everything it brings with it (llbuild, etc). That will make it not possible to be able to build any of the tests on iOS, for example.

But I think it's the exact same issue as the need to test for the -entry-point-function-name flag, so we should be able to use the same solution here.

We should make also add something to the Package to check that there is no transitive dependency of the tests on Build, to give an earlier warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommandsTests already has a transitive dependency on Build via Commands, so I'm not sure this changes much - are these tests being run on iOS today?

The check the entry point name tests use:

#if swift(<5.5)
        try XCTSkipIf(true, "skipping because host compiler doesn't support '-entry-point-function-name'")
#endif

won't work for this because the version of Swift which has the new flag doesn't have a version number yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think this might be fine then, what was problematic was adding the Build dependency in SPMTestSupport so it would be needed for any test suite.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I missed that this was CommandsTests and not SPMTestSupport. This is fine, since only the libSwiftPMDataModel tests are run on iOS. Shelling out on iOS is prohibited anyway, so none of the command-related tests can work.

@neonichu neonichu self-assigned this Jul 6, 2021
Copy link
Contributor

@abertelrud abertelrud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is only adding the Build dependency to CommandsTests (and not the more general SPMTestSupport, which I'd originally thought), this looks fine to me. Thanks!

@owenv owenv marked this pull request as draft July 8, 2021 18:19
@owenv
Copy link
Contributor Author

owenv commented Jul 11, 2021

I verified a toolchain build succeeded @ swiftlang/swift#38285 - I'm going to rerun tests here one more time since it's been a few days

@owenv
Copy link
Contributor Author

owenv commented Jul 11, 2021

@swift-ci please smoke test

@owenv owenv marked this pull request as ready for review July 11, 2021 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants