-
Notifications
You must be signed in to change notification settings - Fork 5k
testrunner: make environment a simple class #2769
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
testrunner: make environment a simple class #2769
Conversation
These could always be emulated with multiple environments.
| @@ -0,0 +1,223 @@ | |||
| const utils = require('./utils'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing copyright.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
test/test.config.js
Outdated
| serverEnvironment.beforeAll(async state => { | ||
| const assetsPath = path.join(__dirname, 'assets'); | ||
| const cachedPath = path.join(__dirname, 'assets', 'cached'); | ||
| const extraLogger = utils.createTestLogger(valueFromEnv('DEBUGP', false), null, 'extra'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be one logger per worker thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
test/test.js
Outdated
| state.page = null; | ||
| }); | ||
| const logger = utils.createTestLogger(config.dumpLogOnFailure); | ||
| const browserEnvironment = new BrowserEnvironment(browserType, launchOptions, logger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should BrowserEnvironment create the logger itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| } | ||
| } | ||
|
|
||
| // simulate globalSetup per browserType that happens only once regardless of TestWorker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use globalSetup!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will go away in the next patch - with first-class artifacts support in test runner.
This re-lands PR microsoft#2769 It was reverted before in microsoft#2790 because it was breaking the new CHANNEL bot.
This re-lands PR microsoft#2769 It was reverted before in microsoft#2790 because it was breaking the new CHANNEL bot.
This patch:
beforeEach,afterEach,beforeAll,afterAll,globalSetupandglobalTeardownditnow adds aTraceTestEnvironmentto the test)//test/environments.jsDownsides: