Some fixes to the live test suite (#32)
CI / Build and test (push) Canceled after 0s
Documentation / Build documentation (push) Canceled after 0s
Documentation / Deploy to GitHub Pages (push) Canceled after 0s

This PR contains the work done to fix the live test suite, which started failing once the Amiibo API began returning Switch 2 games, and tidies the test suite around it.

### Changes

- **Live tests:** replaced the assertion that the first amiibo has no Switch 2 games with a usage check, matching the other platforms. The live data now includes Switch 2 entries for most amiibos.
- **Live tests:** refreshed the minimum item counts and the earliest accepted last-updated date to the values observed in October 2026, and documented in the README how to refresh them.
- **All tests:** moved test descriptions from `@Test("...")` strings into backticked function names, and aligned every case on the same GIVEN/WHEN/THEN structure.
- **Live client:** replaced the TODO about DocC inherited docs with a note. The compiler does not inherit documentation for protocol witnesses, so the repeated doc comments stay on purpose.

Reviewed-on: #32
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #32.
This commit is contained in:
javier authored and Javier Cicchelli committed 2026-10-25 21:53:31 +00:00
1 parent 13b9c74a38
commit 4cbac015b1
8 files changed
+138 -134

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/).