Refreshed the live test baselines for the Amiibo live service as of October 2026.
This commit is contained in:
1 parent
647f63ee1e
commit
2144871193
2 files changed
+21
-11
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user