Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: removed the usage of default_configuration. #1226

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
"benchmark": "node benchmark",
"pretest": "node-gyp rebuild -C test",
"test": "node test",
"test:debug": "node-gyp rebuild -C test --debug && node ./test/index.js",
"test:debug": "node-gyp rebuild -C test --debug && BUILD_TYPE=Debug node ./test/index.js",
"predev": "node-gyp rebuild -C test --debug",
"dev": "node test",
"predev:incremental": "node-gyp configure build -C test --debug",
Expand Down
25 changes: 19 additions & 6 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,25 @@ async function checkBuildType (buildType) {
}

async function whichBuildType () {
legendecas marked this conversation as resolved.
Show resolved Hide resolved
let buildType = 'Release';
if (await checkBuildType(buildTypes.Release)) {
buildType = buildTypes.Release;
}
if (await checkBuildType(buildTypes.Debug)) {
buildType = buildTypes.Debug;
let buildType;
const envBuildType = process.env.BUILD_TYPE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const envBuildType = process.env.BUILD_TYPE;
const envBuildType = process.env.BUILD_TYPE || 'Release';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion in meeting from @vmoroz how about process.env.NODE_API_BUILD_CONFIG

if (envBuildType) {
if (Object.values(buildTypes).includes(envBuildType)) {
if (await checkBuildType(envBuildType)) {
buildType = envBuildType;
} else {
throw new Error(`The ${envBuildType} build doesn't exists.`);
}
} else {
throw new Error('Invalid value for BUILD_TYPE environment variable. It should be set to Release or Debug.');
}
} else {
if (await checkBuildType(buildTypes.Release)) {
buildType = buildTypes.Release;
}
if (await checkBuildType(buildTypes.Debug)) {
buildType = buildTypes.Debug;
}
}
return buildType;
}
Expand Down