diff --git a/package-lock.json b/package-lock.json index 592a096b0..8366d6165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "expect-webdriverio": "3.5.3", "fastq": "1.13.0", "fs-extra": "5.0.0", - "gemini-configparser": "1.3.0", + "gemini-configparser": "1.4.1", "glob-extra": "5.0.2", "lodash": "4.17.21", "looks-same": "9.0.0", @@ -45,8 +45,8 @@ "yallist": "3.1.1" }, "bin": { - "testplane": "./bin/testplane", - "hermione": "./bin/hermione" + "hermione": "bin/hermione", + "testplane": "bin/testplane" }, "devDependencies": { "@commitlint/cli": "^19.0.3", @@ -7653,9 +7653,9 @@ } }, "node_modules/gemini-configparser": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/gemini-configparser/-/gemini-configparser-1.3.0.tgz", - "integrity": "sha512-rUVLH20VIyf6P/DRSgxRuHDmRy3AnfEOVfvy1S1eRkBxgtpHfx54oXqXQqGWdcwVvID9ChC6IbAAfVwN92+SfA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/gemini-configparser/-/gemini-configparser-1.4.1.tgz", + "integrity": "sha512-+A1gQm7/uquIgCYpp4RAxmgqt1CiH7xnYScj+0w4Kofr3odCyFViaLVJ+IBlWU4+w3JF66hFxwEhzudnY0cl6A==", "dependencies": { "lodash": "^4.17.4" } @@ -20478,9 +20478,9 @@ } }, "gemini-configparser": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/gemini-configparser/-/gemini-configparser-1.3.0.tgz", - "integrity": "sha512-rUVLH20VIyf6P/DRSgxRuHDmRy3AnfEOVfvy1S1eRkBxgtpHfx54oXqXQqGWdcwVvID9ChC6IbAAfVwN92+SfA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/gemini-configparser/-/gemini-configparser-1.4.1.tgz", + "integrity": "sha512-+A1gQm7/uquIgCYpp4RAxmgqt1CiH7xnYScj+0w4Kofr3odCyFViaLVJ+IBlWU4+w3JF66hFxwEhzudnY0cl6A==", "requires": { "lodash": "^4.17.4" } diff --git a/package.json b/package.json index d2dd95d52..1cf8d4be7 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "expect-webdriverio": "3.5.3", "fastq": "1.13.0", "fs-extra": "5.0.0", - "gemini-configparser": "1.3.0", + "gemini-configparser": "1.4.1", "glob-extra": "5.0.2", "lodash": "4.17.21", "looks-same": "9.0.0", diff --git a/src/config/options.js b/src/config/options.js index 3994963cc..d813dddce 100644 --- a/src/config/options.js +++ b/src/config/options.js @@ -8,7 +8,7 @@ const optionsBuilder = require("./options-builder"); const options = optionsBuilder(_.propertyOf(defaults)); -const ENV_PREFIX = `${require("../../package").name}_`; +const ENV_PREFIXES = ["testplane_", "hermione_"]; const rootSection = section( _.extend(browserOptions.getTopLevel(), { @@ -104,4 +104,4 @@ const rootSection = section( }), ); -module.exports = root(rootSection, { envPrefix: ENV_PREFIX }); +module.exports = root(rootSection, { envPrefix: ENV_PREFIXES }); diff --git a/test/src/config/options.js b/test/src/config/options.js index db8a4b3ea..00809d179 100644 --- a/test/src/config/options.js +++ b/test/src/config/options.js @@ -81,6 +81,18 @@ describe("config options", () => { assert.deepEqual(result.system[optionName], { some: "opts" }); }); + it("should prefer existing environment option with testplane_ prefix", () => { + const result = parse_({ + options: { system: { [optionName]: {} } }, + env: { + [`hermione_system_${_.snakeCase(optionName)}`]: '{"foo": "bar"}', + [`testplane_system_${_.snakeCase(optionName)}`]: '{"baz": "qux"}', + }, + }); + + assert.deepEqual(result.system[optionName], { baz: "qux" }); + }); + it("should parse option from cli", () => { const result = parse_({ options: { system: { [optionName]: {} } },