chore: dogfood dotenv (#12673)

Use a top-level .env file to control the internal testing setup.

This allows for easy manipulation of environment variables regardless
of your setup (VSCode Extension, CLI, etc.).
This commit is contained in:
Ross Wollman 2022-03-11 15:12:25 -08:00 committed by GitHub
parent d15910b450
commit 72b95b9ffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 0 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@ playwright-report
/packages/*/NOTICE
/packages/playwright/README.md
/packages/playwright-core/api.json
.env

16
package-lock.json generated
View File

@ -49,6 +49,7 @@
"copy-webpack-plugin": "^9.1.0",
"cross-env": "^7.0.3",
"css-loader": "^6.5.1",
"dotenv": "^16.0.0",
"electron": "^12.2.1",
"enquirer": "^2.3.6",
"eslint": "^8.8.0",
@ -3016,6 +3017,15 @@
"tslib": "^2.0.3"
}
},
"node_modules/dotenv": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz",
"integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/duplexer3": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
@ -9783,6 +9793,12 @@
"tslib": "^2.0.3"
}
},
"dotenv": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz",
"integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==",
"dev": true
},
"duplexer3": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",

View File

@ -79,6 +79,7 @@
"copy-webpack-plugin": "^9.1.0",
"cross-env": "^7.0.3",
"css-loader": "^6.5.1",
"dotenv": "^16.0.0",
"electron": "^12.2.1",
"enquirer": "^2.3.6",
"eslint": "^8.8.0",

View File

@ -14,6 +14,9 @@
* limitations under the License.
*/
import { config as loadEnv } from 'dotenv';
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test';
import * as path from 'path';
import { ServerWorkerOptions } from './serverFixtures';

View File

@ -14,6 +14,9 @@
* limitations under the License.
*/
import { config as loadEnv } from 'dotenv';
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test';
import * as path from 'path';
import { TestModeWorkerOptions } from './testModeFixtures';

View File

@ -14,6 +14,9 @@
* limitations under the License.
*/
import { config as loadEnv } from 'dotenv';
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test';
import * as path from 'path';
import { CoverageWorkerOptions } from './coverageFixtures';

View File

@ -14,6 +14,9 @@
* limitations under the License.
*/
import { config as loadEnv } from 'dotenv';
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
import { Config } from './stable-test-runner';
import * as path from 'path';