Skip to content

Commit

Permalink
ci: replace basic registry e2e tests by e2e-launcher.js
Browse files Browse the repository at this point in the history
  • Loading branch information
thomvaill committed Nov 22, 2024
1 parent 6f682c0 commit 68f8098
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/reusable-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ jobs:
with:
node-version-file: ${{ inputs.node-version-file }}
node-version: ${{ inputs.node-version }}
cache: yarn
cache-dependency-path: yarn.lock

# We install project dependencies to be able to run e2e-launcher.js
- run: yarn install --frozen-lockfile

# But we do install log4brains from the registry
- run: npm install -g ${{ inputs.npm-package-fullname }}

# TODO: test the preview and add some assertions :-) For now we just check the exit codes. Or manage to run e2e-tests/e2e-launcher.js from here
- name: Tests
run: |
log4brains --version
log4brains init --defaults
log4brains adr list
log4brains build
# We don't use "yarn e2e" directly so we are sure that we are using the global version of log4brains
- name: E2E Tests on the registry version
run: node e2e-launcher.js
working-directory: e2e-tests
2 changes: 2 additions & 0 deletions e2e-tests/e2e-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ async function run(file, arguments, cwd) {

(async () => {
await usingTempDir(async (cwd) => {
await run("log4brains", ["--version"], cwd);

await run("log4brains", ["init", "--defaults"], cwd);

await run("log4brains", ["adr", "new", "--quiet", '"E2E test ADR"'], cwd);
Expand Down

0 comments on commit 68f8098

Please sign in to comment.