Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests for Windows and add Azure Pipelines for cross platform CI (#…
…5410) * Add azure pipelines * Add gitattributes * Updating tests to work on Windows or Unix * Lint * Cleaning up * Fixing names * Clean up naming * try to consolidate images * Clean up * Add back txt to gitattributes
- Loading branch information
Showing
33 changed files
with
403 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Make sure baseline files have consistent line endings | ||
*.txt text eol=lf | ||
*.snap text eol=lf | ||
*.debug-check text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '$(node_version)' | ||
displayName: 'Install Node.js' | ||
|
||
- script: npm install -g yarn | ||
displayName: 'Get yarn' | ||
|
||
- script: yarn install | ||
displayName: 'yarn install' | ||
|
||
- script: yarn test | ||
displayName: 'Test' | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: '**/junit.xml' | ||
condition: succeededOrFailed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
trigger: | ||
- master | ||
- releases/* | ||
|
||
jobs: | ||
|
||
# Build and test on Windows | ||
- job: Test_Windows | ||
displayName: Tests on Windows Node8 | ||
pool: | ||
vmImage: vs2017-win2016 | ||
variables: | ||
node_version: 8.x | ||
report_summaries: true | ||
steps: | ||
- template: azure-pipelines-tests.yml | ||
|
||
# Build and test on macOS | ||
- job: Test_macOS | ||
displayName: Tests on macOS Node8 | ||
pool: | ||
vmImage: macos-10.13 | ||
variables: | ||
node_version: 8.x | ||
report_summaries: true | ||
steps: | ||
- template: azure-pipelines-tests.yml | ||
|
||
# Test on Linux | ||
- job: Test_Linux | ||
displayName: Run tests | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
strategy: | ||
matrix: | ||
Node8: | ||
node_version: '8.x' | ||
Node11: | ||
node_version: '11.x' | ||
variables: | ||
report_summaries: true | ||
steps: | ||
- template: azure-pipelines-tests.yml | ||
|
||
# Test production bundle on Linux using Node 4 | ||
- job: Prod_Linux | ||
displayName: Test production bundle on Linux | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
strategy: | ||
matrix: | ||
Node4: | ||
node_version: '4.x' | ||
Node9: | ||
node_version: '9.x' | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '11.x' | ||
displayName: 'Install Node.js' | ||
|
||
- script: npm install -g yarn | ||
displayName: 'Get yarn' | ||
|
||
- script: yarn install | ||
displayName: 'yarn install' | ||
|
||
- script: yarn check-deps | ||
displayName: 'Check dependencies' | ||
|
||
- script: yarn build | ||
displayName: 'Build' | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '$(node_version)' | ||
displayName: 'Use Node.js $(node_version)' | ||
|
||
- script: npm install -g yarn@1.5 | ||
displayName: 'Get yarn compatible with node 4' | ||
condition: eq(variables['node_version'], '4.x') | ||
|
||
- script: node ./scripts/test-dist.js | ||
displayName: 'Test' | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: '**/junit.xml' | ||
condition: and(variables['report_summaries'], succeededOrFailed()) | ||
|
||
# Lint checks on Linux | ||
- job: Lint_linux | ||
displayName: Lint (Linux) | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '8.x' | ||
displayName: 'Install Node.js' | ||
|
||
- script: yarn install | ||
displayName: 'yarn install' | ||
|
||
- script: yarn lint | ||
displayName: 'Lint code' | ||
|
||
- script: yarn lint-docs | ||
displayName: 'Lint docs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
tests_integration/__tests__/__snapshots__/eol-crlf.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Has correct default Windows line endings (stderr) 1`] = `""`; | ||
|
||
exports[`Has correct default Windows line endings (stdout) 1`] = ` | ||
"function f() { | ||
console.log(\\"should have tab width 8\\") | ||
} | ||
function f() { | ||
console.log(\\"should have space width 2\\") | ||
} | ||
function f() { | ||
console.log(\\"should have space width 8\\") | ||
} | ||
function f() { | ||
console.log( | ||
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\" | ||
) | ||
} | ||
console.log(\\"jest/__best-tests__/file.js should have semi\\");/*CR*/ | ||
console.log(\\"jest/Component.js should not have semi\\")/*CR*/ | ||
console.log(\\"jest/Component.test.js should have semi\\");/*CR*/ | ||
function js() { | ||
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\"); | ||
} | ||
\\"use strict\\"; | ||
module.exports = { | ||
endOfLine: \\"lf\\", | ||
tabWidth: 8 | ||
}; | ||
function noConfigJs() { | ||
console.log(\\"no-config/file.js should have no semicolons\\") | ||
} | ||
function packageJs() {/*CR*/ | ||
console.log(\\"package/file.js should have tab width 3\\");/*CR*/ | ||
}/*CR*/ | ||
function rcJson() {/*CR*/ | ||
console.log.apply(null, [/*CR*/ | ||
'rc-json/file.js',/*CR*/ | ||
'should have trailing comma',/*CR*/ | ||
'and single quotes',/*CR*/ | ||
]);/*CR*/ | ||
}/*CR*/ | ||
function rcToml() {/*CR*/ | ||
console.log.apply(null, [/*CR*/ | ||
'rc-toml/file.js',/*CR*/ | ||
'should have trailing comma',/*CR*/ | ||
'and single quotes',/*CR*/ | ||
]);/*CR*/ | ||
}/*CR*/ | ||
function rcYaml() {/*CR*/ | ||
console.log.apply(null, [/*CR*/ | ||
'rc-yaml/file.js',/*CR*/ | ||
'should have trailing comma',/*CR*/ | ||
'and single quotes',/*CR*/ | ||
]);/*CR*/ | ||
}/*CR*/ | ||
" | ||
`; | ||
|
||
exports[`Has correct default Windows line endings (write) 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Has correct default Unix line endings (stderr) 1`] = `""`; | ||
|
||
exports[`Has correct default Unix line endings (stdout) 1`] = ` | ||
"function f() { | ||
console.log(\\"should have tab width 8\\") | ||
} | ||
function f() { | ||
console.log(\\"should have space width 2\\") | ||
} | ||
function f() { | ||
console.log(\\"should have space width 8\\") | ||
} | ||
function f() { | ||
console.log( | ||
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\" | ||
) | ||
} | ||
console.log(\\"jest/__best-tests__/file.js should have semi\\"); | ||
console.log(\\"jest/Component.js should not have semi\\") | ||
console.log(\\"jest/Component.test.js should have semi\\"); | ||
function js() { | ||
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\"); | ||
} | ||
\\"use strict\\"; | ||
module.exports = { | ||
endOfLine: \\"lf\\", | ||
tabWidth: 8 | ||
}; | ||
function noConfigJs() { | ||
console.log(\\"no-config/file.js should have no semicolons\\") | ||
} | ||
function packageJs() { | ||
console.log(\\"package/file.js should have tab width 3\\"); | ||
} | ||
function rcJson() { | ||
console.log.apply(null, [ | ||
'rc-json/file.js', | ||
'should have trailing comma', | ||
'and single quotes', | ||
]); | ||
} | ||
function rcToml() { | ||
console.log.apply(null, [ | ||
'rc-toml/file.js', | ||
'should have trailing comma', | ||
'and single quotes', | ||
]); | ||
} | ||
function rcYaml() { | ||
console.log.apply(null, [ | ||
'rc-yaml/file.js', | ||
'should have trailing comma', | ||
'and single quotes', | ||
]); | ||
} | ||
" | ||
`; | ||
|
||
exports[`Has correct default Unix line endings (write) 1`] = `Array []`; |
Oops, something went wrong.