-
Notifications
You must be signed in to change notification settings - Fork 0
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
Azure Pipelines support #2
Conversation
|
||
variables: | ||
CI: true | ||
VSTS_OVERWRITE_TEMP: True |
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.
Setting VSTS_OVERWRITE_TEMP
avoids test problems related to weirdness with "temp" path math (especially on Windows where the short and long file paths are different)
@@ -33,7 +33,7 @@ module.exports = (resolve, rootDir, isEjecting) => { | |||
setupFilesAfterEnv: setupTestsFile ? [setupTestsFile] : [], | |||
testMatch: [ | |||
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', | |||
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}', | |||
'<rootDir>/src/**/*(*.)@(spec|test).{js,jsx,ts,tsx}', |
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.
See jestjs/jest#7914 for details. This change was needed because of a breaking change in Jest v24.
original_npm_registry_url=`npm get registry` | ||
original_yarn_registry_url=`yarn config get registry` | ||
|
||
# Load Verdaccio-related functions |
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.
Consolidated all Verdaccio related logic into one script that each of the e2e scripts now references (avoids a bunch of duplication).
tasks/verdaccio.sh
Outdated
function startVerdaccio { | ||
# Start local registry | ||
tmp_registry_log=`mktemp` | ||
(cd && nohup npx https://createreactapp.blob.core.windows.net/lib/verdaccio-4.0.0-alpha.5.tgz -c $1 &>$tmp_registry_log &) |
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.
Using a patched version of Verdaccio (for now) that allows us to configure HTTP Agent options (request/agentOptions
). This is necessary to work around an Azure VM specific issue caused when too many sockets are opened. See https://docs.microsoft.com/en-us/azure/app-service/app-service-web-nodejs-best-practices-and-troubleshoot-guide#my-node-application-is-making-excessive-outbound-calls
@@ -184,6 +173,10 @@ CI=true yarn test | |||
# Eject... | |||
echo yes | npm run eject | |||
|
|||
# Temporary workaround for https://github.com/facebook/create-react-app/issues/6099 | |||
rm yarn.lock |
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 workaround is due to facebook#6679 (which looks like a duplicate of facebook#6099). Without this, build/test almost always fails due to a missing @babel plugin. Like is discussed in the issues, I haven't found a way to repro locally (at least not consistently).
@@ -33,9 +33,9 @@ function execaSafe(...args) { | |||
stderr: stripYarn( | |||
stripAnsi( | |||
err.message | |||
.split(os.EOL) | |||
.split('\n') |
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.
stdout lines are separated by \n
on Windows, too
@@ -59,7 +59,10 @@ test('formats missing package', async () => { | |||
path.join(testSetup.testDirectory, 'src', 'App.js') | |||
); | |||
|
|||
const { stdout, stderr } = await testSetup.scripts.build(); | |||
let { stdout, stderr } = await testSetup.scripts.build(); |
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.
The snapshot includes unix-style paths, but the stderr returned here on Windows includes Windows-style paths (causing these tests to fail prior to this change). This is a somewhat hacky way to "normalize" the paths (i.e. make them unix-style) prior to comparison with the snapshot. Jest does something similar (fwiw).
Azure Pipelines support (Linux, macOS, and Windows)
No description provided.