diff --git a/Justfile b/Justfile index 7d7ca4d..c2f3fdf 100644 --- a/Justfile +++ b/Justfile @@ -7,14 +7,6 @@ unittest: testyt: cargo test --features=rss --test youtube -testyt10: - #!/usr/bin/env bash - set -e - for i in {1..10}; do \ - echo "---TEST RUN $i---"; \ - cargo test --features=rss --test youtube; \ - done - testintl: #!/usr/bin/env bash LANGUAGES=( @@ -47,4 +39,4 @@ testfiles: report2yaml: mkdir -p rustypipe_reports/conv - for f in rustypipe_reports/*.json; do yq '.http_request.resp_body' $f | yq -o json -P > rustypipe_reports/conv/`basename $f .json`_body.json; yq e -Pi $f; mv $f rustypipe_reports/conv/`basename $f .json`.yaml; done; + for f in rustypipe_reports/*.json; do yq '.http_request.resp_body' $f | yq -o json -P > rustypipe_reports/conv/`basename $f .json`_body.json; yq e -Pi "del(.http_request.resp_body)" $f; mv $f rustypipe_reports/conv/`basename $f .json`.yaml; done; diff --git a/README.md b/README.md index a237ebc..83bd294 100644 --- a/README.md +++ b/README.md @@ -154,3 +154,29 @@ Subscribers: 1780000 [6Fv8bd9ICb4] Who owns this? (199s) ... ``` + +## Development + +**Requirements:** + +- Current version of stable Rust +- [`just`](https://github.com/casey/just) task runner +- [`pre-commit`](https://pre-commit.com/) +- yq (YAML processor) + +### Tasks + +**Testing** + +- `just test` Run unit+integration tests +- `just unittest` Run unit tests +- `just testyt` Run YouTube integration tests +- `just testintl` Run YouTube integration tests for all supported languages (this takes + a long time and is therefore not run in CI) +- `YT_LANG=de just testyt` Run YouTube integration tests for a specific language + +**Tools** + +- `just testfiles` Download missing testfiles for unit tests +- `just report2yaml` Convert RustyPipe reports into a more readable yaml format + (requires `yq`) diff --git a/tests/youtube.rs b/tests/youtube.rs index e3c9027..0f448de 100644 --- a/tests/youtube.rs +++ b/tests/youtube.rs @@ -1278,10 +1278,10 @@ fn trending(rp: RustyPipe) { false, )] #[case::short( - "RDCLAK5uy_kFQXdnqMaQCVx2wpUM4ZfbsGCDibZtkJk", - "Easy Pop", + "RDCLAK5uy_nLNY4ReQKH2kx5U23cyGMHql9ciHD9RSM", + "Presenting BLACKPINK (λΈ”λž™ν•‘ν¬)", false, - Some("Stress-free tunes from classic rockers and newer artists.\nThis playlist is no longer being updated.".to_owned()), + Some("The most played hits and essential tracks. #blackpink #best #kpop".to_owned()), None, true )] @@ -2181,7 +2181,7 @@ fn music_genres(rp: RustyPipe, unlocalized: bool) { let chill = genres .iter() .find(|g| g.id == "ggMPOg1uX1JOQWZFeDByc2Jm") - .unwrap(); + .expect("genre: Chill"); if unlocalized { assert_eq!(chill.name, "Chill"); } @@ -2189,8 +2189,8 @@ fn music_genres(rp: RustyPipe, unlocalized: bool) { let pop = genres .iter() - .find(|g| g.id == "ggMPOg1uX1lMbVZmbzl6NlJ3") - .unwrap(); + .find(|g| g.id == "ggMPOg1uX1lMbVZmbzl6NlJ3" || g.id == "ggMPOg1uX1BmNzc2V2p0YXJ5") + .expect("genre: Pop"); assert_eq!(pop.name, "Pop"); assert!(!pop.is_mood);