From 55dd1eadfe2e4eea2a30e28503f9ee0eac5c542c Mon Sep 17 00:00:00 2001 From: Kevin Le Perf Date: Sun, 12 Nov 2023 03:10:30 +0100 Subject: [PATCH] Fix tests and data accordingly --- data/tfc.json | 4 ++-- .../kotlin/eu/codlab/lorcana/utils/GithubDefinitions.kt | 2 +- .../commonTest/kotlin/eu/codlab/lorcana/TestLoadingCards.kt | 2 +- .../kotlin/eu/codlab/lorcana/TestLoadingCompiledSet.kt | 2 +- scripts/publish.sh | 6 ++++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/data/tfc.json b/data/tfc.json index 1a337cc..a9311c5 100644 --- a/data/tfc.json +++ b/data/tfc.json @@ -8386,7 +8386,7 @@ "illustrator": "Grace Tran", "number": 170, "rarity": "uncommon", - "franchise_id": null, + "franchise_id": "frozen", "languages": { "en": { "name": "Scepter Of Arendelle", @@ -9823,7 +9823,7 @@ "illustrator": "Amber Kommavongsa", "number": 199, "rarity": "uncommon", - "franchise_id": null, + "franchise_id": "the-emperors-new-groove", "languages": { "en": { "name": "Ransack", diff --git a/library/lorcana-data/src/commonMain/kotlin/eu/codlab/lorcana/utils/GithubDefinitions.kt b/library/lorcana-data/src/commonMain/kotlin/eu/codlab/lorcana/utils/GithubDefinitions.kt index 953cc08..48f9e1c 100644 --- a/library/lorcana-data/src/commonMain/kotlin/eu/codlab/lorcana/utils/GithubDefinitions.kt +++ b/library/lorcana-data/src/commonMain/kotlin/eu/codlab/lorcana/utils/GithubDefinitions.kt @@ -10,7 +10,7 @@ internal object GithubDefinitions { val url = "https://raw.githubusercontent.com/codlab/lorcana-data/$version/data/$file.json" val request = Provider.client.get(url) - if (request.status.isSuccess()) { + if (!request.status.isSuccess()) { throw FileNotFoundException("Impossible to find the file $file for version $version") } diff --git a/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCards.kt b/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCards.kt index 356f706..4561849 100644 --- a/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCards.kt +++ b/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCards.kt @@ -40,7 +40,7 @@ class TestLoadingCards { } listOf( - Resources.files.d23 to 23, + Resources.files.d23 to 24, Resources.files.tfc to 216 ).forEach { set -> val (file, count) = set diff --git a/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCompiledSet.kt b/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCompiledSet.kt index 875ddf2..eb46e28 100644 --- a/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCompiledSet.kt +++ b/library/lorcana-data/src/commonTest/kotlin/eu/codlab/lorcana/TestLoadingCompiledSet.kt @@ -59,7 +59,7 @@ class TestLoadingCompiledSet { private suspend fun runTestList(provider: suspend (set: Set) -> List) { listOf( - Set.D23 to 23, + Set.D23 to 24, Set.TFC to 216 ).forEach { pair -> val (set, count) = pair diff --git a/scripts/publish.sh b/scripts/publish.sh index 1e4f481..3f585fe 100644 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,8 +1,10 @@ #!/bin/bash +set -xe + # running validation -./gradlew ktlint detekt || (echo "invalid ktlint/detekt output"; exit 1) -./gradlew check || (echo "tests failed"; exit 1) +./gradlew ktlint detekt +./gradlew check # simple implementation of delivering locally & then publicly ./gradlew publishToMavenLocal && ./gradlew publishAllPublicationsToSonatypeRepository closeAndReleaseStagingRepository