Skip to content

Commit df5941d

Browse files
chore: keep coverage directories in-place for test-initialize and test-migrate (#1132)
## PR Checklist - [x] Addresses an existing open issue: fixes #1131 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Keeps them running on `./coverage`, then swaps that to `./coverage-*` later in the workflow. Comparing the performance of the two end-to-end test types from `main` (c06c62c): | Test | Baseline | Update | Δ | | ------------ | -------- | -------- | ---------------------- | | `initialize` | `1m 25s` | `1m 21s` | ~0% (near zero change) | | `migrate` | `2m 45s` | `30s` | 81% faster | Seems like this mostly improves migration. I guess initialization didn't have this bottleneck as badlly, and still runs the initialize script twice.
1 parent c06c62c commit df5941d

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.github/workflows/test-initialize.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ jobs:
66
- uses: ./.github/actions/prepare
77
- run: pnpm run build
88
- run: pnpm run test:initialize
9+
# The template's .eslintignore only ignores coverage, not coverage-*
10+
# https://github.com/JoshuaKGoldberg/create-typescript-app/issues/1131
11+
- if: always()
12+
run: mv coverage coverage-initialize
913
- if: always()
1014
name: Codecov
1115
uses: codecov/codecov-action@v3

.github/workflows/test-migrate.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ jobs:
66
- uses: ./.github/actions/prepare
77
- run: pnpm run build
88
- run: pnpm run test:migrate
9+
# The template's .eslintignore only ignores coverage, not coverage-*
10+
# https://github.com/JoshuaKGoldberg/create-typescript-app/issues/1131
11+
- if: always()
12+
run: mv coverage coverage-migrate
913
- if: always()
1014
name: Codecov
1115
uses: codecov/codecov-action@v3

script/initialize-test-e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ await $`pnpm i`;
4949
await $`pnpm run build`;
5050
await $({
5151
stdio: "inherit",
52-
})`c8 -o ./coverage-initialize -r html -r lcov --src src node ./bin/index.js --base everything --description ${description} --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-removal --skip-restore`;
52+
})`c8 -o ./coverage -r html -r lcov --src src node ./bin/index.js --base everything --description ${description} --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-removal --skip-restore`;

script/migrate-test-e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const title = "Create TypeScript App";
1111

1212
await $({
1313
stdio: "inherit",
14-
})`c8 -o ./coverage-migrate -r html -r lcov --src src node ./bin/index.js --base everything --mode migrate --description ${description} --email-github ${emailGithub} --email-npm ${emailNpm} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-install`;
14+
})`c8 -o ./coverage -r html -r lcov --src src node ./bin/index.js --base everything --mode migrate --description ${description} --email-github ${emailGithub} --email-npm ${emailNpm} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-install`;
1515

1616
const { stdout: gitStatus } = await $`git status`;
1717
console.log(`Stdout from running \`git status\`:\n${gitStatus}`);

0 commit comments

Comments
 (0)