Skip to content

Commit

Permalink
disable clippy on rstest which would fail without the right env var
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Sep 26, 2024
1 parent 11a283a commit f435931
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ all-features = true
default = ["all"]
all = ["url"]
wpt-tests = []
# This feature is used to disable compiling the WPT tests in the CI
# when using `--all-features`. If this feature is enabled, we disable
# the compilation of the WPT tests (since they will panic).
# Clippy will be disabled for those methods as well, but they're one
# line long.
wpt-tests-do-not-use = []
6 changes: 6 additions & 0 deletions core/runtime/tests/wpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ impl TestCompletion {
}

/// Load and execute the test file.
// This can be marked as allow unused because it would give false positives
// in clippy.
#[allow(unused)]
fn execute_test_file(path: &Path) {
let dir = path.parent().unwrap();
let wpt_path = PathBuf::from(
Expand Down Expand Up @@ -286,6 +289,7 @@ fn execute_test_file(path: &Path) {
}

/// Test the console with the WPT test suite.
#[cfg(not(feature = "wpt-tests-do-not-use"))]
#[rstest::rstest]
fn console(
#[base_dir = "${WPT_ROOT}"]
Expand All @@ -300,6 +304,7 @@ fn console(

/// Test the text encoder/decoder with the WPT test suite.
#[ignore] // TODO: support all encodings.
#[cfg(not(feature = "wpt-tests-do-not-use"))]
#[rstest::rstest]
fn encoding(
#[base_dir = "${WPT_ROOT}"]
Expand All @@ -313,6 +318,7 @@ fn encoding(
/// Test the URL class with the WPT test suite.
// A bunch of these tests are failing due to lack of support in the URL class,
// or missing APIs such as fetch.
#[cfg(not(feature = "wpt-tests-do-not-use"))]
#[rstest::rstest]
fn url(
#[base_dir = "${WPT_ROOT}"]
Expand Down

0 comments on commit f435931

Please sign in to comment.