Skip to content

Commit 2ed0c46

Browse files
committed
Fix CI
1 parent fd9982e commit 2ed0c46

7 files changed

Lines changed: 35 additions & 10 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v2
1818
- uses: taiki-e/install-action@cargo-hack
19-
- name: Build
20-
run: cargo hack build --each-feature --verbose
2119
- name: Run tests
22-
run: cargo hack test --each-feature --verbose
20+
run: ./scripts/test-features.sh

scripts/test-features.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -ueo pipefail
4+
5+
cargo metadata --format-version 1 | jq '.packages[] | select(.name == "scryfall") | .features | keys[]' -r | while read -r feature; do
6+
cargo test --no-default-features --features "$feature,default-tls"
7+
done
8+
9+
cargo test --all-features

src/card.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ pub struct Card {
287287
/// the same name (tokens, Unstable variants, etc).
288288
pub oracle_id: Option<Uuid>,
289289

290+
/// This card’s Resource ID on Gatherer, if any.
291+
pub resource_id: Option<String>,
292+
290293
/// A link to where you can begin paginating all re/prints for this card on
291294
/// Scryfall’s API.
292295
pub prints_search_uri: Uri<List<Card>>,

src/search.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,20 @@ mod tests {
335335

336336
#[tokio::test]
337337
async fn numeric_property_comparison_buffered() {
338-
let card = Card::search_random(Query::And(vec![
339-
power(eq(NumProperty::Toughness)),
340-
pow_tou(eq(NumProperty::Cmc)),
341-
not(CardIs::Funny),
342-
]))
343-
.await
344-
.unwrap();
338+
let card = loop {
339+
let card = Card::search_random(Query::And(vec![
340+
power(eq(NumProperty::Toughness)),
341+
pow_tou(eq(NumProperty::Cmc)),
342+
not(CardIs::Funny),
343+
]))
344+
.await
345+
.unwrap();
346+
347+
// dfcs have don't have power and toughness on the top level card
348+
if card.power.is_some() || card.toughness.is_some() {
349+
break card;
350+
}
351+
};
345352

346353
let power = card
347354
.power

tests/variants-feature/default_variants.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ fn match_on_promo_type(f: PromoType) {
230230
PromoType::Vault => todo!(),
231231
PromoType::Wizardsplaynetwork => todo!(),
232232
PromoType::DragonScaleFoil => todo!(),
233+
PromoType::Beginnerbox => todo!(),
234+
PromoType::Manafoil => todo!(),
235+
PromoType::Resale => todo!(),
236+
PromoType::Sldbonus => todo!(),
237+
PromoType::Sourcematerial => todo!(),
238+
PromoType::Startercollection => todo!(),
233239
_ => todo!(),
234240
}
235241
}

tests/variants-feature/unknown_variants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ fn match_on_promo_type(f: PromoType) {
211211
PromoType::Silverfoil => todo!(),
212212
PromoType::Singularityfoil => todo!(),
213213
PromoType::Sldbonus => todo!(),
214+
PromoType::Sourcematerial => todo!(),
214215
PromoType::Stamped => todo!(),
215216
PromoType::Startercollection => todo!(),
216217
PromoType::Starterdeck => todo!(),

tests/variants-feature/unknown_variants_slim.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ fn match_on_promo_type(f: PromoType) {
217217
PromoType::Silverfoil => todo!(),
218218
PromoType::Singularityfoil => todo!(),
219219
PromoType::Sldbonus => todo!(),
220+
PromoType::Sourcematerial => todo!(),
220221
PromoType::Stamped => todo!(),
221222
PromoType::Startercollection => todo!(),
222223
PromoType::Starterdeck => todo!(),

0 commit comments

Comments
 (0)