Skip to content

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 bkhouri and rauhul 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