Some fixes to the live test suite #32
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.
|
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
|
## Documentation
|
||||||
|
|
||||||
See the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/).
|
See the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/).
|
||||||
@@ -181,8 +181,8 @@ struct AmiiboServiceLiveTests {
|
|||||||
@Test
|
@Test
|
||||||
func `get the last updated timestamp`() async throws {
|
func `get the last updated timestamp`() async throws {
|
||||||
try await assertLastUpdated(
|
try await assertLastUpdated(
|
||||||
onOrAfterDay: 24,
|
onOrAfterDay: 22,
|
||||||
month: 7,
|
month: 10,
|
||||||
year: 2026
|
year: 2026
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -583,16 +583,16 @@ enum Output {
|
|||||||
// MARK: - Constants
|
// MARK: - Constants
|
||||||
|
|
||||||
private extension Int {
|
private extension Int {
|
||||||
/// A number that represents the minimum number of amiibo items 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 = 946
|
static let minimumAmiibos = 952
|
||||||
/// A number that represents the minimum number of amiibo series expected from the live service, as of July 2026.
|
/// A number that represents the minimum number of amiibo series expected from the live service, as of October 2026.
|
||||||
static let minimumAmiiboSeries = 31
|
static let minimumAmiiboSeries = 32
|
||||||
/// 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 types expected from the live service, as of October 2026.
|
||||||
static let minimumAmiiboTypes = 5
|
static let minimumAmiiboTypes = 5
|
||||||
/// A number that represents the minimum number of game characters expected from the live service, as of July 2026.
|
/// A number that represents the minimum number of game characters expected from the live service, as of October 2026.
|
||||||
static let minimumGameCharacters = 681
|
static let minimumGameCharacters = 685
|
||||||
/// A number that represents the minimum number of game series expected from the live service, as of July 2026.
|
/// A number that represents the minimum number of game series expected from the live service, as of October 2026.
|
||||||
static let minimumGameSeries = 118
|
static let minimumGameSeries = 119
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension String {
|
private extension String {
|
||||||
|
|||||||
Reference in new issue
Block a user