Skip to content

Re-enable APIDiff tests #8196

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 5 commits into from
Jan 9, 2025
Merged

Re-enable APIDiff tests #8196

merged 5 commits into from
Jan 9, 2025

Conversation

yyvch
Copy link
Contributor

@yyvch yyvch commented Jan 4, 2025

Re-enable APIDiff tests.

Motivation:

I noticed that APIDiff tests are skipped when using most recent Swift (confirmed on 6.0.2 on MacOS, 6.0.3 on Linux and 6.2-dev nightly on Linux). Upon enabling I noticed that 2 tests are failing.

Modifications:

  • Enable the test suite by modifying condition from implicit versioning to explicit versioning
  • Update the test suite to be run by default
  • Adjust asserts to be less brittle for testFilters and testCheckVendedModulesOnly

Result:

  • Tests are run by default
  • All tests pass (verified on 6.0.2 on MacOS, 6.0.3 on Linux and 6.2-dev-2024-12-22-a nightly on Linux)

yyvch added 3 commits January 3, 2025 15:19
The tests rely on Swift compiler version later than 5.5, but the
guard condition didn't age well: the tests are skipped on 6.0.2
and 6.2-dev nightly. The change updates the skipping guard to
explicitly check for version 6.0-or-later.
The two modified tests started failing after implementation change of
the underlying tool. Imports stopped being considered breaking changes
by itself in swiftlang/swift#63554.
Since swiftlang#3697
the APIDiff tests were opt-in which set expectation that the
tests should skip by default. This change makes the APIDiff tests
to run by default so then we could rely on CI status and assurance
of test coverage.
@plemarquand
Copy link
Contributor

@swift-ci test

diagnose-api-breaking-changes output errors like:

```
1 breaking change detected in Baz:
  💔 API breakage: enumelement Baz.b has been added as a new enum case
```

The change switches from asserting that `Baz` was present
to asserting that pattern matches `N breaking changes detected in Baz`.

Negative asserts (XCTAssertNoMatch) remains as permissive as possible,
to allow more room for detecting a failure.
@yyvch yyvch requested review from rauhul and bkhouri January 7, 2025 19:57
@bkhouri
Copy link
Contributor

bkhouri commented Jan 8, 2025

@swift-ci please test

@bkhouri bkhouri merged commit ba273eb into swiftlang:main Jan 9, 2025
5 checks passed
@yyvch yyvch deleted the apidiff-tests branch January 22, 2025 23:16
bkhouri pushed a commit that referenced this pull request Jan 23, 2025
- Description: Fix build error for `diagnose-api-breaking-changes`
command when C code is in non-standard location
 - Scope: Package
 - Risk: Low
- Testing: New test for this specific scenario. However, the test suite
is deactivated in 6.1 unless
[#8196](#8196) is
cherry-picked too.
 - Issue: #8073
- Cherry-picked from:
#8209
 - Author: @yyvch 
 - Reviewers: @plemarquand @jakepetroules
bripeticca pushed a commit to bripeticca/swift-package-manager that referenced this pull request Feb 28, 2025
Re-enable APIDiff tests.

### Motivation:

I noticed that APIDiff tests are skipped when using most recent Swift
(confirmed on 6.0.2 on MacOS, 6.0.3 on Linux and 6.2-dev nightly on
Linux). Upon enabling I noticed that 2 tests are failing.

### Modifications:

- Enable the test suite by modifying condition from implicit versioning
to explicit versioning
 - Update the test suite to be run by default
- Adjust asserts to be less brittle for `testFilters` and
`testCheckVendedModulesOnly`

### Result:

 - Tests are run by default
- All tests pass (verified on 6.0.2 on MacOS, 6.0.3 on Linux and
6.2-dev-2024-12-22-a nightly on Linux)
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