-
-
Couldn't load subscription status.
- Fork 1.7k
ci(test-matrix): Add logs for getTestMatrix
#17673
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -48,10 +48,24 @@ function run(): void { | |||||
|
|
||||||
| const { base, head = 'HEAD', optional } = values; | ||||||
|
|
||||||
| // For GitHub Action debugging | ||||||
| // eslint-disable-next-line no-console | ||||||
| console.error(`Parsed command line arguments: base=${base}, head=${head}, optional=${optional}`); | ||||||
|
|
||||||
| const testApplications = globSync('*/package.json', { | ||||||
| cwd: `${__dirname}/../test-applications`, | ||||||
| }).map(filePath => dirname(filePath)); | ||||||
|
|
||||||
| // For GitHub Action debugging (using stderr the 'matrix=...' output is not polluted) | ||||||
| // eslint-disable-next-line no-console | ||||||
| console.error( | ||||||
mydea marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| `Discovered ${testApplications.length} test applications${ | ||||||
| testApplications.length > 0 | ||||||
|
||||||
| ? ` (sample: ${JSON.stringify(testApplications.slice(0, 10))}${testApplications.length > 10 ? ' …' : ''})` | ||||||
| : '' | ||||||
| }`, | ||||||
| ); | ||||||
|
|
||||||
| // If `--base=xxx` is defined, we only want to get test applications changed since that base | ||||||
| // Else, we take all test applications (e.g. on push) | ||||||
| const includedTestApplications = base | ||||||
|
|
@@ -137,11 +151,22 @@ function getAffectedTestApplications( | |||||
| additionalArgs.push(`--head=${head}`); | ||||||
| } | ||||||
|
|
||||||
| const affectedProjects = execSync(`yarn --silent nx show projects --affected ${additionalArgs.join(' ')}`) | ||||||
| .toString() | ||||||
| .split('\n') | ||||||
| .map(line => line.trim()) | ||||||
| .filter(Boolean); | ||||||
| let affectedProjects: string[] = []; | ||||||
| try { | ||||||
| affectedProjects = execSync(`yarn --silent nx show projects --affected ${additionalArgs.join(' ')}`) | ||||||
| .toString() | ||||||
| .split('\n') | ||||||
| .map(line => line.trim()) | ||||||
| .filter(Boolean); | ||||||
| } catch (error) { | ||||||
| // eslint-disable-next-line no-console | ||||||
| console.warn('Failed to compute affected projects via Nx. Running all tests instead.', error); | ||||||
|
||||||
| console.warn('Failed to compute affected projects via Nx. Running all tests instead.', error); | |
| console.error('Failed to compute affected projects via Nx. Running all tests instead.', error); |
here an error is def. warranted xD
Uh oh!
There was an error while loading. Please reload this page.