Skip to content

Commit

Permalink
added logging to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DzenanJupic committed Jun 9, 2021
1 parent f054b5d commit e8b164f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LOG: debug

jobs:
build_and_test:
Expand All @@ -38,4 +40,4 @@ jobs:
toolchain: ${{ matrix.toolchain }}
default: true
- name: Run tests
run: cargo test --workspace --all-features
run: cargo test --workspace --all-features -- --nocapture
5 changes: 3 additions & 2 deletions .github/workflows/test_download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LOG: debug

jobs:
build_and_test:
Expand All @@ -29,6 +30,6 @@ jobs:
toolchain: ${{ matrix.toolchain }}
default: true
- name: Run test `download_to`
run: cargo test -p rustube --all-features --test download download_to -- --exact --ignored
run: cargo test -p rustube --all-features --test download download_to -- --exact --ignored --nocapture
- name: Run test `download_age_restricted_to_dir`
run: cargo test -p rustube --all-features --test download download_age_restricted_to_dir -- --exact --ignored
run: cargo test -p rustube --all-features --test download download_age_restricted_to_dir -- --exact --ignored --nocapture
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ url = { version = "2.2.1" }

[dev-dependencies]
rand = "0.8.1"
test-env-log = "0.2.7"
env_logger = "0.8.3"
tokio = { version = "1.0.1", features = ["full"] }
tokio-test = "0.4.0"

Expand Down
8 changes: 4 additions & 4 deletions tests/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustube::VideoFetcher;
#[macro_use]
mod common;

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn download() {
let id = random_id(PRE_SIGNED);
Expand All @@ -24,7 +24,7 @@ async fn download() {
correct_path!(path, expected_path);
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn download_age_restricted_to_dir() {
let id = random_id(AGE_RESTRICTED);
Expand Down Expand Up @@ -60,7 +60,7 @@ fn blocking_download_to_dir() {
correct_path!(path, expected_path);
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn download_to_dir() {
let id = random_id(PRE_SIGNED);
Expand All @@ -76,7 +76,7 @@ async fn download_to_dir() {
correct_path!(path, expected_path);
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn download_to() {
let id = random_id(PRE_SIGNED);
Expand Down
14 changes: 7 additions & 7 deletions tests/video_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustube::video_info::player_response::playability_status::PlayabilityStatus;
#[macro_use]
mod common;

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_has_signature_cipher() {
let id = random_id(SIGNATURE_CIPHER);
Expand All @@ -16,7 +16,7 @@ async fn video_has_signature_cipher() {
assert!(random_entry(video.streams()).signature_cipher.s.is_some());
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_is_pre_signed() {
let id = random_id(PRE_SIGNED);
Expand All @@ -25,7 +25,7 @@ async fn video_is_pre_signed() {
assert!(random_entry(video.streams()).signature_cipher.s.is_none());
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_is_age_restricted() {
let id = random_id(AGE_RESTRICTED);
Expand All @@ -34,7 +34,7 @@ async fn video_is_age_restricted() {
assert!(video.is_age_restricted());
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_is_private_video() {
let id = random_id(PRIVATE);
Expand All @@ -57,7 +57,7 @@ async fn video_is_private_video() {
}
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_is_region_blocked() {
let id = random_id(REGION_BLOCKED);
Expand All @@ -80,7 +80,7 @@ async fn video_is_region_blocked() {
}
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_has_missing_recording() {
let id = random_id(MISSING_RECORDING);
Expand All @@ -103,7 +103,7 @@ async fn video_has_missing_recording() {
}
}

#[tokio::test]
#[test_env_log::test(tokio::test)]
#[ignore]
async fn video_is_live_stream() {
let id = random_id(LIVE_STREAM);
Expand Down

0 comments on commit e8b164f

Please sign in to comment.