From 448fe67b7a2142f62332b651f9d215534dceb1f5 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 28 May 2024 14:58:43 -0400 Subject: feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) Includes: * https://github.com/denoland/deno_graph/pull/486 * https://github.com/denoland/deno_graph/pull/488 * https://github.com/denoland/deno_lockfile/pull/25 * https://github.com/denoland/deno_lockfile/pull/22 * https://github.com/denoland/deno_graph/pull/483 * https://github.com/denoland/deno_graph/pull/470 --- .../lockfile/config_file_lock_path/019_media_types.ts.out | 1 + tests/specs/lockfile/config_file_lock_path/__test__.jsonc | 13 +++++++++++++ .../config_file_lock_path/config_file_lock_path.json | 3 +++ .../config_file_lock_path/config_file_lock_path.out | 11 +++++++++++ .../lockfile/config_file_lock_path/lock_check_err2.json | 10 ++++++++++ .../lockfile/config_file_lock_path/lock_check_err2.out | 11 +++++++++++ .../lockfile/config_file_lock_path/lock_check_ok2.json | 13 +++++++++++++ .../lockfile/config_file_lock_path/run/lock_check_ok2.json | 14 ++++++++++++++ 8 files changed, 76 insertions(+) create mode 100644 tests/specs/lockfile/config_file_lock_path/019_media_types.ts.out create mode 100644 tests/specs/lockfile/config_file_lock_path/__test__.jsonc create mode 100644 tests/specs/lockfile/config_file_lock_path/config_file_lock_path.json create mode 100644 tests/specs/lockfile/config_file_lock_path/config_file_lock_path.out create mode 100644 tests/specs/lockfile/config_file_lock_path/lock_check_err2.json create mode 100644 tests/specs/lockfile/config_file_lock_path/lock_check_err2.out create mode 100644 tests/specs/lockfile/config_file_lock_path/lock_check_ok2.json create mode 100644 tests/specs/lockfile/config_file_lock_path/run/lock_check_ok2.json (limited to 'tests/specs/lockfile/config_file_lock_path') diff --git a/tests/specs/lockfile/config_file_lock_path/019_media_types.ts.out b/tests/specs/lockfile/config_file_lock_path/019_media_types.ts.out new file mode 100644 index 000000000..b3e94678c --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/019_media_types.ts.out @@ -0,0 +1 @@ +[WILDCARD]success true true true true true true true true diff --git a/tests/specs/lockfile/config_file_lock_path/__test__.jsonc b/tests/specs/lockfile/config_file_lock_path/__test__.jsonc new file mode 100644 index 000000000..defb113b3 --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tests": { + "error_bad_checksum": { + "args": "run --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", + "output": "config_file_lock_path.out", + "exitCode": 10 + }, + "lock_flag_override": { + "args": "run --lock=run/lock_check_ok2.json --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", + "output": "019_media_types.ts.out" + } + } +} diff --git a/tests/specs/lockfile/config_file_lock_path/config_file_lock_path.json b/tests/specs/lockfile/config_file_lock_path/config_file_lock_path.json new file mode 100644 index 000000000..2c393f76e --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/config_file_lock_path.json @@ -0,0 +1,3 @@ +{ + "lock": "./lock_check_err2.json" +} diff --git a/tests/specs/lockfile/config_file_lock_path/config_file_lock_path.out b/tests/specs/lockfile/config_file_lock_path/config_file_lock_path.out new file mode 100644 index 000000000..1383d945d --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/config_file_lock_path.out @@ -0,0 +1,11 @@ +[WILDCARD]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/mt_text_ecmascript.j3.js + Actual: 3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18 + Expected: bad + +This could be caused by: + * the lock file may be corrupt + * the source itself may be corrupt + +Use the --lock-write flag to regenerate the lockfile or --reload to reload the source code from the server. diff --git a/tests/specs/lockfile/config_file_lock_path/lock_check_err2.json b/tests/specs/lockfile/config_file_lock_path/lock_check_err2.json new file mode 100644 index 000000000..a59cbc9e3 --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/lock_check_err2.json @@ -0,0 +1,10 @@ +{ + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "bad", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" +} diff --git a/tests/specs/lockfile/config_file_lock_path/lock_check_err2.out b/tests/specs/lockfile/config_file_lock_path/lock_check_err2.out new file mode 100644 index 000000000..1383d945d --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/lock_check_err2.out @@ -0,0 +1,11 @@ +[WILDCARD]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/mt_text_ecmascript.j3.js + Actual: 3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18 + Expected: bad + +This could be caused by: + * the lock file may be corrupt + * the source itself may be corrupt + +Use the --lock-write flag to regenerate the lockfile or --reload to reload the source code from the server. diff --git a/tests/specs/lockfile/config_file_lock_path/lock_check_ok2.json b/tests/specs/lockfile/config_file_lock_path/lock_check_ok2.json new file mode 100644 index 000000000..14d8b7117 --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/lock_check_ok2.json @@ -0,0 +1,13 @@ +{ + "version": "3", + "remote": { + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" + } +} diff --git a/tests/specs/lockfile/config_file_lock_path/run/lock_check_ok2.json b/tests/specs/lockfile/config_file_lock_path/run/lock_check_ok2.json new file mode 100644 index 000000000..e1bf67c8f --- /dev/null +++ b/tests/specs/lockfile/config_file_lock_path/run/lock_check_ok2.json @@ -0,0 +1,14 @@ +{ + "version": "3", + "remote": { + "http://localhost:4545/run/019_media_types.ts": "6b099d422b8a83e19d6672ad28c1c42dd3523eaadd8029f185bf4d10c1dc6e92", + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" + } +} -- cgit v1.2.3