Skip to content

Commit f7ed139

Browse files
author
Craigory Coppola
committed
fix(repo): e2e tests run in CI again
1 parent dd5fd61 commit f7ed139

File tree

8 files changed

+17194
-204
lines changed

8 files changed

+17194
-204
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
name: Building affected apps
16-
if: needs.pre-run.outputs.skip != 'true'
1716
steps:
1817
- uses: actions/checkout@v1
1918
- uses: bahmutov/npm-install@v1.4.5
@@ -22,7 +21,6 @@ jobs:
2221
test:
2322
runs-on: ubuntu-latest
2423
name: Testing affected apps
25-
if: needs.pre-run.outputs.skip != 'true'
2624
steps:
2725
- uses: actions/checkout@v1
2826
- uses: bahmutov/npm-install@v1.4.5
@@ -31,17 +29,26 @@ jobs:
3129
lint:
3230
runs-on: ubuntu-latest
3331
name: Linting affected apps
34-
if: needs.pre-run.outputs.skip != 'true'
3532
steps:
3633
- uses: actions/checkout@v1
3734
- uses: bahmutov/npm-install@v1.4.5
3835
- run: yarn nx affected --target=lint --base=origin/master~1 --parallel
3936

37+
e2e:
38+
runs-on: ubuntu-latest
39+
name: E2E testing affected apps
40+
needs: [build]
41+
steps:
42+
- uses: actions/checkout@v1
43+
- uses: bahmutov/npm-install@v1.4.5
44+
- run: yarn e2e
45+
- run: git reset --hard
46+
4047
semantic-release:
4148
runs-on: ubuntu-latest
4249
name: Publish packages via semantic release
43-
needs: [test]
44-
if: ${{needs.pre-run.outputs.skip != 'true' && github.event_name == 'push'}}
50+
needs: [test, e2e]
51+
if: ${{github.event_name == 'push'}}
4552
steps:
4653
- uses: actions/checkout@v1
4754
- uses: actions/setup-node@v1
@@ -63,18 +70,3 @@ jobs:
6370
env:
6471
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6572
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
66-
67-
# e2e:
68-
# runs-on: ubuntu-latest
69-
# name: E2E testing affected apps
70-
# needs: [pre-run, build]
71-
# if: needs.pre-run.outputs.skip == 'false'
72-
# steps:
73-
# - uses: actions/checkout@v1
74-
# - uses: bahmutov/npm-install@v1.4.5
75-
# - name: Download a single artifact
76-
# uses: actions/download-artifact@v2
77-
# with:
78-
# name: dist
79-
# path: dist
80-
# - run: yarn e2e

.github/workflows/pr.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@ jobs:
4242
- uses: bahmutov/npm-install@v1.4.5
4343
- run: yarn commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose
4444

45-
# e2e:
46-
# runs-on: ubuntu-latest
47-
# name: E2E testing affected apps
48-
# needs: [pre-run, build]
49-
# if: needs.pre-run.outputs.skip == 'false'
50-
# steps:
51-
# - uses: actions/checkout@v1
52-
# - uses: bahmutov/npm-install@v1.4.5
53-
# - name: Download a single artifact
54-
# uses: actions/download-artifact@v2
55-
# with:
56-
# name: dist
57-
# path: dist
58-
# - run: yarn e2e
45+
e2e:
46+
runs-on: ubuntu-latest
47+
name: E2E testing affected apps
48+
needs: [build]
49+
steps:
50+
- uses: actions/checkout@v1
51+
- uses: bahmutov/npm-install@v1.4.5
52+
# - name: Download a single artifact
53+
# uses: actions/download-artifact@v2
54+
# with:
55+
# name: dist
56+
# path: dist
57+
- run: yarn e2e

e2e/utils/index.ts

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { dirSync } from 'tmp';
1818

1919
interface RunCmdOpts {
2020
silenceError?: boolean;
21-
env?: Record<string, string>;
21+
env?: Record<string, string> | NodeJS.ProcessEnv;
2222
cwd?: string;
2323
silent?: boolean;
2424
}
@@ -146,21 +146,7 @@ export function newProject({ name = uniq('proj') } = {}): string {
146146
updateFile('.npmrc', 'prefer-frozen-lockfile=false');
147147
}
148148

149-
const packages = [
150-
`@nrwl/angular`,
151-
`@nrwl/express`,
152-
`@nrwl/jest`,
153-
`@nrwl/linter`,
154-
`@nrwl/nest`,
155-
`@nrwl/next`,
156-
`@nrwl/gatsby`,
157-
`@nrwl/node`,
158-
`@nrwl/react`,
159-
`@nrwl/storybook`,
160-
`@nrwl/nx-plugin`,
161-
`@nrwl/eslint-plugin-nx`,
162-
`@nrwl/web`,
163-
];
149+
const packages = [`@nx-dotnet/core`, `@nx-dotnet/typescript`];
164150
packageInstall(packages.join(` `), projScope);
165151

166152
if (useBackupProject) {
@@ -231,7 +217,7 @@ export function runCommandUntil(
231217
let output = '';
232218
let complete = false;
233219

234-
function checkCriteria(c) {
220+
function checkCriteria(c: any) {
235221
output += c.toString();
236222
if (criteria(output)) {
237223
complete = true;
@@ -242,8 +228,8 @@ export function runCommandUntil(
242228
}
243229
}
244230

245-
p.stdout.on('data', checkCriteria);
246-
p.stderr.on('data', checkCriteria);
231+
p.stdout?.on('data', checkCriteria);
232+
p.stderr?.on('data', checkCriteria);
247233
p.on('exit', (code) => {
248234
if (code !== 0 && !complete) {
249235
console.log(output);
@@ -272,7 +258,7 @@ export function runNgAdd(
272258
command?: string,
273259
opts: RunCmdOpts = {
274260
silenceError: false,
275-
env: process.env,
261+
env: process.env as Record<string, string>,
276262
cwd: tmpProjPath(),
277263
},
278264
): string {
@@ -322,7 +308,7 @@ export function runCLI(
322308
}
323309

324310
const needsMaxWorkers = /g.*(express|nest|node|web|react):app.*/;
325-
if (needsMaxWorkers.test(command)) {
311+
if (command && needsMaxWorkers.test(command)) {
326312
setMaxWorkers();
327313
}
328314

0 commit comments

Comments
 (0)