-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #626 from embroider-build/windows-tests
setup windows tests
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 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
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,56 @@ | ||
import execa from 'execa'; | ||
|
||
async function githubMatrix() { | ||
let { stdout } = await execa( | ||
'npx', | ||
[ | ||
'scenario-tester', | ||
'list', | ||
'--require', | ||
'ts-node/register', | ||
'--files', | ||
'*-test.ts', | ||
'--matrix', | ||
'npm run test -- --filter %s', | ||
], | ||
{ | ||
preferLocal: true, | ||
} | ||
); | ||
|
||
let { include: suites } = JSON.parse(stdout) as { include: { name: string; command: string }[]; name: string[] }; | ||
|
||
let include = [ | ||
...suites.map(s => ({ | ||
name: `${s.name} ubuntu`, | ||
os: 'ubuntu', | ||
command: s.command, | ||
})), | ||
...suites | ||
// only run release tests in windows for now as a smoke test and not slow down CI too much | ||
.filter(s => !['canary', 'beta', 'lts', 'ember3'].some(i => s.name.includes(i))) | ||
// this test fails in windows because of a command imcompatibility with powershell. | ||
// This is low priority but if someone had the time to look into PRs are welcome 👍 | ||
.filter(s => s.name !== 'release-sample-addon') | ||
.map(s => ({ | ||
name: `${s.name} windows`, | ||
os: 'windows', | ||
command: s.command, | ||
})), | ||
]; | ||
|
||
return { | ||
name: include.map(s => s.name), | ||
include, | ||
}; | ||
} | ||
|
||
async function main() { | ||
const result = await githubMatrix(); | ||
|
||
process.stdout.write(JSON.stringify(result)); | ||
} | ||
|
||
if (require.main === module) { | ||
main(); | ||
} |