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

Azure Pipelines support #2

Closed
wants to merge 35 commits into from
Closed

Azure Pipelines support #2

wants to merge 35 commits into from

Conversation

willsmythe
Copy link
Owner

No description provided.


variables:
CI: true
VSTS_OVERWRITE_TEMP: True
Copy link
Owner Author

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}',
Copy link
Owner Author

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
Copy link
Owner Author

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/e2e-simple.sh Outdated Show resolved Hide resolved
tasks/e2e-simple.sh Outdated Show resolved Hide resolved
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 &)
Copy link
Owner Author

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

tasks/verdaccio.yaml Outdated Show resolved Hide resolved
@@ -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
Copy link
Owner Author

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')
Copy link
Owner Author

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();
Copy link
Owner Author

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).

@willsmythe willsmythe closed this Apr 2, 2019
willsmythe pushed a commit that referenced this pull request May 2, 2019
Azure Pipelines support (Linux, macOS, and Windows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants