diff --git a/Cargo.lock b/Cargo.lock index f8bc40a20ae8ce..05d7e30f4a4983 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1860,9 +1860,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.87.2" +version = "0.87.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4766f426e4258c481c3af019fb4bba31e3108e80b8b2a48bbeb68bfadcc8c18" +checksum = "0f1d2f0aa5832b72abdc67e904649aa80ec707f0a5f8cc7825859221b56abd31" dependencies = [ "async-trait", "capacity_builder 0.5.0", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ce3b31f69ef560..4d72a643d399ea 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -72,7 +72,7 @@ deno_config = { workspace = true, features = ["sync", "workspace"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "=0.164.0", features = ["rust", "comrak"] } deno_error.workspace = true -deno_graph = { version = "=0.87.2" } +deno_graph = { version = "=0.87.3" } deno_lib.workspace = true deno_lint = { version = "0.72.0" } deno_lockfile.workspace = true diff --git a/tests/specs/lockfile/auto_discover_lockfile/main.out b/tests/specs/lockfile/auto_discover_lockfile/main.out index 110f7e85ba8cfe..0884eb27e52787 100644 --- a/tests/specs/lockfile/auto_discover_lockfile/main.out +++ b/tests/specs/lockfile/auto_discover_lockfile/main.out @@ -1,5 +1,6 @@ Download http://localhost:4545/subdir/mod2.ts Download http://localhost:4545/subdir/print_hello.ts +Download http://localhost:4545/subdir/print_hello.ts error: Integrity check failed for remote specifier. The source code is invalid, as it does not match the expected hash in the lock file. Specifier: http://localhost:4545/subdir/print_hello.ts diff --git a/tests/specs/lockfile/cache_bust_integrity_failure/__test__.jsonc b/tests/specs/lockfile/cache_bust_integrity_failure/__test__.jsonc new file mode 100644 index 00000000000000..e8270a3a5b172b --- /dev/null +++ b/tests/specs/lockfile/cache_bust_integrity_failure/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tempDir": true, + "envs": { + "DENO_DIR": "./deno_dir" + }, + "steps": [{ + "args": "cache --allow-import main.ts", + "output": "[WILDCARD]" + }, { + "args": "run -A update.ts", + "output": "[WILDCARD]" + }, { + "args": "run --allow-import main.ts", + "output": "main.out" + }] +} diff --git a/tests/specs/lockfile/cache_bust_integrity_failure/deno.json b/tests/specs/lockfile/cache_bust_integrity_failure/deno.json new file mode 100644 index 00000000000000..9db918e2f5bf83 --- /dev/null +++ b/tests/specs/lockfile/cache_bust_integrity_failure/deno.json @@ -0,0 +1,5 @@ +{ + "lock": { + "frozen": true + } +} diff --git a/tests/specs/lockfile/cache_bust_integrity_failure/deno.lock b/tests/specs/lockfile/cache_bust_integrity_failure/deno.lock new file mode 100644 index 00000000000000..b7b217cd6a6df3 --- /dev/null +++ b/tests/specs/lockfile/cache_bust_integrity_failure/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "4", + "remote": { + "http://localhost:4545/welcome.ts": "7353d5fcbc36c45d26bcbca478cf973092523b07c45999f41319820092b4de31" + } +} diff --git a/tests/specs/lockfile/cache_bust_integrity_failure/main.out b/tests/specs/lockfile/cache_bust_integrity_failure/main.out new file mode 100644 index 00000000000000..314341191dfd4d --- /dev/null +++ b/tests/specs/lockfile/cache_bust_integrity_failure/main.out @@ -0,0 +1,3 @@ +[# should download because it cache busts] +Download http://localhost:4545/welcome.ts +Welcome to Deno! diff --git a/tests/specs/lockfile/cache_bust_integrity_failure/main.ts b/tests/specs/lockfile/cache_bust_integrity_failure/main.ts new file mode 100644 index 00000000000000..7556f226676137 --- /dev/null +++ b/tests/specs/lockfile/cache_bust_integrity_failure/main.ts @@ -0,0 +1 @@ +import "http://localhost:4545/welcome.ts"; diff --git a/tests/specs/lockfile/cache_bust_integrity_failure/update.ts b/tests/specs/lockfile/cache_bust_integrity_failure/update.ts new file mode 100644 index 00000000000000..9e430f2ff54e6d --- /dev/null +++ b/tests/specs/lockfile/cache_bust_integrity_failure/update.ts @@ -0,0 +1,6 @@ +// make the path in the deno_dir differ from the remote server +// and what's stored in the lockfile +const filePath = + "./deno_dir/remote/http/localhost_PORT4545/3011c891e5bd4172aa2e157e4c688ab6f31e91da9719704a9a54aa63faa99c88"; +const text = Deno.readTextFileSync(filePath); +Deno.writeTextFileSync(filePath, "//\n" + text); diff --git a/tests/specs/lockfile/no_lock/fail.out b/tests/specs/lockfile/no_lock/fail.out index 14a8d19cfea92a..7be558a3bb251f 100644 --- a/tests/specs/lockfile/no_lock/fail.out +++ b/tests/specs/lockfile/no_lock/fail.out @@ -1,4 +1,5 @@ Download http://localhost:4545/lockfile/basic/mod.ts +Download http://localhost:4545/lockfile/basic/mod.ts error: Integrity check failed for remote specifier. The source code is invalid, as it does not match the expected hash in the lock file. Specifier: http://localhost:4545/lockfile/basic/mod.ts diff --git a/tests/specs/run/wasm_module/integrity_check_failed/main.out b/tests/specs/run/wasm_module/integrity_check_failed/main.out index 6434bfcf937062..db69504f977318 100644 --- a/tests/specs/run/wasm_module/integrity_check_failed/main.out +++ b/tests/specs/run/wasm_module/integrity_check_failed/main.out @@ -1,4 +1,5 @@ Download http://localhost:4545/wasm/math.wasm +Download http://localhost:4545/wasm/math.wasm error: Integrity check failed for remote specifier. The source code is invalid, as it does not match the expected hash in the lock file. Specifier: http://localhost:4545/wasm/math.wasm diff --git a/tests/util/server/src/assertions.rs b/tests/util/server/src/assertions.rs index 9eb39fb4a8cd84..d204b0e6617b24 100644 --- a/tests/util/server/src/assertions.rs +++ b/tests/util/server/src/assertions.rs @@ -65,7 +65,10 @@ pub fn assert_wildcard_match_with_logger( expected: &str, logger: &mut dyn Write, ) { - if !expected.contains("[WILD") && !expected.contains("[UNORDERED_START]") { + if !expected.contains("[WILD") + && !expected.contains("[UNORDERED_START]") + && !expected.contains("[#") + { pretty_assertions::assert_eq!(actual, expected); } else { match crate::wildcard_match_detailed(expected, actual) {