| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir.
Sorry, something went wrong.
|
With this change: $ cat /home/rlau/node-tmp/package.json
{"main": "dep.js"}
$ NODE_TEST_DIR=/home/rlau/node-tmp node test/pummel/test-policy-integrity.js
assert.js:145
throw err;
^
AssertionError [ERR_ASSERTION]: This test shouldn't load properties from a package.json above its file location. Found package.json at /home/rlau/node-tmp/package.json.
at Proxy.requireNoPackageJSONAbove (/home/rlau/sandbox/github/node/test/common/index.js:716:14)
at Object.<anonymous> (/home/rlau/sandbox/github/node/test/pummel/test-policy-integrity.js:79:8)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: undefined,
expected: undefined,
operator: 'fail'
}
$
compared to without: $ cat /home/rlau/node-tmp/package.json
{"main": "dep.js"}
$ NODE_TEST_DIR=/home/rlau/node-tmp node test/pummel/test-policy-integrity.js
permutation 118 failed
{
config: {
onError: 'exit',
shouldSucceed: true,
entryPath: './worker-spawner.cjs',
willDeletePolicy: true,
preloads: [],
parentPath: './parent.js',
depPath: './dep.js',
resources: {
'./dep.js': {
body: '',
integrities: [
'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=',
'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='
]
},
'./parent.js': {
body: '\n' +
' if (!process.env.DEP_FILE) {\n' +
' console.error(\n' +
" 'missing required DEP_FILE env to determine dependency'\n" +
' );\n' +
' process.exit(33);\n' +
' }\n' +
' require(process.env.DEP_FILE)\n' +
' ',
integrities: [
'sha256-AzbH3oEA96J/+tLSqOJ+LaIt9vdOY+ikShkvKm0VutU=',
'sha256-R0QVSw9BUI7znwKNvt6BuzkLozhYKTtFNRSENIL5H7k='
]
},
'./worker-spawner.cjs': {
body: '\n' +
" const path = require('path');\n" +
" const { Worker } = require('worker_threads');\n" +
' if (!process.env.PARENT_FILE) {\n' +
' console.error(\n' +
" 'missing required PARENT_FILE env to determine worker entry point'\n" +
' );\n' +
' process.exit(33);\n' +
' }\n' +
' if (!process.env.DELETABLE_POLICY_FILE) {\n' +
' console.error(\n' +
" 'missing required DELETABLE_POLICY_FILE env to check reloading'\n" +
' );\n' +
' process.exit(33);\n' +
' }\n' +
' const w = new Worker(path.resolve(process.env.PARENT_FILE));\n' +
" w.on('exit', (status) => process.exit(status === 0 ? 0 : 1));\n",
integrities: [
'sha256-23P4m8edtJAPTH24RJHIHMEuMVgP7QKcgWBSyj6FxPc=',
'sha256-XTRkNC3vxo+zvjv7CD8iapeqc7npNN7TwqRR0TOv5lg='
]
}
}
},
manifest: {
onerror: 'exit',
resources: {
'file:///home/rlau/node-tmp/.tmp.0/test-policy-integrity-permutation-118/dep.js': {
integrity: 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=',
dependencies: true
},
'file:///home/rlau/node-tmp/.tmp.0/test-policy-integrity-permutation-118/parent.js': {
integrity: 'sha256-AzbH3oEA96J/+tLSqOJ+LaIt9vdOY+ikShkvKm0VutU= sha256-R0QVSw9BUI7znwKNvt6BuzkLozhYKTtFNRSENIL5H7k=',
dependencies: true
},
'file:///home/rlau/node-tmp/.tmp.0/test-policy-integrity-permutation-118/worker-spawner.cjs': {
integrity: 'sha256-23P4m8edtJAPTH24RJHIHMEuMVgP7QKcgWBSyj6FxPc= sha256-XTRkNC3vxo+zvjv7CD8iapeqc7npNN7TwqRR0TOv5lg=',
dependencies: true
}
}
}
}
exit code: 1 signal: null
stdout:
stderr:
/home/rlau/sandbox/github/node/test/pummel/test-policy-integrity.js:187
throw e;
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
1 !== 0
at ChildProcess.<anonymous> (/home/rlau/sandbox/github/node/test/pummel/test-policy-integrity.js:170:18)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 1,
expected: 0,
operator: 'strictEqual'
}
$
|
Sorry, something went wrong.
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Policy tests can fail if a package.json exists in any of the parent
directories above the test. The existing checks are done for the
ancestors of the test directory but some tests execute from the tmpdir.
Refs: #38088
Refs: #35600
Refs: #35633
cc @bmeck