Skip to content

Commit

Permalink
new node openssl override
Browse files Browse the repository at this point in the history
  • Loading branch information
delambo committed Apr 8, 2024
1 parent 0c9b2eb commit 944a9f1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
9 changes: 6 additions & 3 deletions e2e_tests/tests/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ describe('KYT CLI', () => {
it(`sets up a ${slug} starter-kyt`, () => {
const exec = new Promise(resolve => {
shell.cd(rootPath);
const child = shell.exec('../packages/kyt-core/lib/index.js setup', (code, stdout) => {
resolve({ code, output: stdout });
});
const child = shell.exec(
'NODE_OPTIONS=--openssl-legacy-provider ../packages/kyt-core/lib/index.js setup',
(code, stdout) => {
resolve({ code, output: stdout });
}
);
let skdone = false;
let chooseDone = false;
let ypmDone = false;
Expand Down
8 changes: 5 additions & 3 deletions e2e_tests/tests/kyt-build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ describe('kyt build', () => {
it('should compile files into a build directory', () => {
util.setupStageWithFixture(stageName, 'build-default');

const output = shell.exec('../packages/kyt-core/lib/index.js build');
const output = shell.exec(
'NODE_OPTIONS=--openssl-legacy-provider ../packages/kyt-core/lib/index.js build'
);

expect(shell.test('-f', 'build/publicAssets.json')).toBe(true);
expect(shell.test('-d', 'build/server')).toBe(true);
Expand Down Expand Up @@ -46,15 +48,15 @@ describe('kyt build', () => {

it('should ignore server build if hasServer=false', () => {
util.setupStageWithFixture(stageName, 'build-no-server');
const output = shell.exec('npm run build');
const output = shell.exec('NODE_OPTIONS=--openssl-legacy-provider npm run build');

expect(output.code).toBe(0);
expect(shell.test('-d', 'build/server')).toBe(false);
});

it('should ignore client build if hasClient=false', () => {
util.setupStageWithFixture(stageName, 'build-no-client');
const output = shell.exec('npm run build');
const output = shell.exec('NODE_OPTIONS=--openssl-legacy-provider npm run build');

expect(output.code).toBe(0);
expect(shell.test('-d', 'build/server')).toBe(true);
Expand Down
17 changes: 10 additions & 7 deletions e2e_tests/tests/starter-kyt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('starter kyts', () => {
it('should start a dev server on :3000', () => {
let outputTest;
const run = new Promise(resolve => {
const child = shell.exec(`${kytCli} dev`, () => {
const child = shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} dev`, () => {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
resolve(outputTest);
});
child.stdout.on('data', data => {
Expand All @@ -38,11 +38,14 @@ describe('starter kyts', () => {

it('should build and run', () => {
let outputTest;
shell.exec(`${kytCli} build`);
shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} build`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
const run = new Promise(resolve => {
const child = shell.exec('node build/server/main.js', () => {
resolve(outputTest);
});
const child = shell.exec(
'NODE_OPTIONS=--openssl-legacy-provider node build/server/main.js',
() => {
resolve(outputTest);
}
);
child.stdout.on('data', data => {
if (data.includes('✅ server started on port: 3000')) {
shell.exec('sleep 5');
Expand Down Expand Up @@ -71,7 +74,7 @@ describe('starter kyts', () => {
it('should start a server on :3001', () => {
let outputTest;
const run = new Promise(resolve => {
const child = shell.exec(`${kytCli} dev`, () => {
const child = shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} dev`, () => {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
resolve(outputTest);
});
child.stdout.on('data', data => {
Expand All @@ -87,7 +90,7 @@ describe('starter kyts', () => {
});

it('should build', () => {
const output = shell.exec(`${kytCli} build`);
const output = shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} build`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.

expect(output.stdout).toContain('✅ Done building');

Expand Down

0 comments on commit 944a9f1

Please sign in to comment.