Some fixes to the live test suite #32

Merged
javier merged 4 commits from library/tests-fixes into main 2026-10-25 21:53:32 +00:00
2 changed files with 21 additions and 11 deletions
Showing only changes of commit 2144871193 - Show all commits

No files matched your search

+10
View File
@@ -133,6 +133,16 @@ AMIIBO_LIVE_TESTS=1 swift test
In Xcode, set the variable in the scheme's **Test** action.
The live tests compare the responses against baselines recorded from the service: minimum item counts per endpoint and the earliest accepted last-updated date. These live in the `Int` extension at the bottom of `AmiiboServiceLiveTests.swift` and in the `get the last updated timestamp` test. Refresh them occasionally by fetching the current totals and the current timestamp from the service, then updating the constants and their `as of` notes:
```shell
for endpoint in amiibo amiiboseries type character gameseries; do
printf '%s: ' "$endpoint"
curl -s "https://www.amiiboapi.org/api/$endpoint/" | python3 -c 'import json,sys; print(len(json.load(sys.stdin)["amiibo"]))'
done
curl -s https://www.amiiboapi.org/api/lastupdated/
```
## Documentation
See the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/).
@@ -181,8 +181,8 @@ struct AmiiboServiceLiveTests {
@Test
func `get the last updated timestamp`() async throws {
try await assertLastUpdated(
onOrAfterDay: 24,
month: 7,
onOrAfterDay: 22,
month: 10,
year: 2026
)
}
@@ -583,16 +583,16 @@ enum Output {
// MARK: - Constants
private extension Int {
/// A number that represents the minimum number of amiibo items expected from the live service, as of July 2026.
static let minimumAmiibos = 946
/// A number that represents the minimum number of amiibo series expected from the live service, as of July 2026.
static let minimumAmiiboSeries = 31
/// A number that represents the minimum number of amiibo types expected from the live service, as of July 2026.
/// A number that represents the minimum number of amiibo items expected from the live service, as of October 2026.
static let minimumAmiibos = 952
/// A number that represents the minimum number of amiibo series expected from the live service, as of October 2026.
static let minimumAmiiboSeries = 32
/// A number that represents the minimum number of amiibo types expected from the live service, as of October 2026.
static let minimumAmiiboTypes = 5
/// A number that represents the minimum number of game characters expected from the live service, as of July 2026.
static let minimumGameCharacters = 681
/// A number that represents the minimum number of game series expected from the live service, as of July 2026.
static let minimumGameSeries = 118
/// A number that represents the minimum number of game characters expected from the live service, as of October 2026.
static let minimumGameCharacters = 685
/// A number that represents the minimum number of game series expected from the live service, as of October 2026.
static let minimumGameSeries = 119
}
private extension String {