Skip to content

[GitHub Workflow] Fix e2e test + cache node_modules#6500

Merged
louislam merged 9 commits intomasterfrom
revert-6491-fix/tag-ui-bug
Dec 18, 2025
Merged

[GitHub Workflow] Fix e2e test + cache node_modules#6500
louislam merged 9 commits intomasterfrom
revert-6491-fix/tag-ui-bug

Conversation

@louislam
Copy link
Copy Markdown
Owner

@louislam louislam commented Dec 17, 2025

This pr is just used to investigate, not meant to be merged.

Not sure if some kind of race condition after #6491.

https://github.com/louislam/uptime-kuma/actions/runs/20300273022/job/58303870710

Edit:

This is because example.com had changed their NS record.

@louislam
Copy link
Copy Markdown
Owner Author

That's weird, it is still failed at the same point.

It looks like we didn't change anything else.

@louislam louislam force-pushed the revert-6491-fix/tag-ui-bug branch from 0960d1d to 09017fb Compare December 17, 2025 23:35
@louislam louislam linked an issue Dec 18, 2025 that may be closed by this pull request
1 task
@louislam louislam changed the title Investigate e2e test fail Fix e2e test Dec 18, 2025
@louislam louislam changed the title Fix e2e test [GitHub Workflow] Fix e2e test + cache node_modules Dec 18, 2025
@louislam louislam marked this pull request as ready for review December 18, 2025 02:06
Copilot AI review requested due to automatic review settings December 18, 2025 02:06
@louislam louislam enabled auto-merge (squash) December 18, 2025 02:06
@louislam louislam merged commit a36616c into master Dec 18, 2025
24 checks passed
@louislam louislam deleted the revert-6491-fix/tag-ui-bug branch December 18, 2025 02:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses e2e test failures caused by changes to example.com's NS records and implements node_modules caching across GitHub workflows to improve CI performance.

Key Changes:

  • Updates DNS NS test data from example.com to kuma.pet with corresponding nameserver values
  • Adds node_modules caching to all workflow jobs using actions/cache@v4
  • Restructures job dependencies to run e2e-test before other test jobs

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.

File Description
test/e2e/specs/monitor-form.spec.js Updates DNS NS test to use kuma.pet domain with Cloudflare nameservers instead of example.com with IANA servers
.github/workflows/auto-test.yml Adds node_modules caching, changes job dependencies, updates e2e-test runner to ARM64, pins Playwright version, and switches from npm ci to npm install
.github/workflows/close-incorrect-issue.yml Removes npm cache configuration from setup-node action

Comment on lines +36 to +42
- name: Cache/Restore node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caching strategy is incomplete. After restoring the cache, the workflow should check if the cache was hit and only run npm ci when the cache misses. Without this check, npm install will run every time, which defeats the purpose of caching. Add a condition like if: steps.node-modules-cache.outputs.cache-hit != 'true' to the npm install step.

Copilot uses AI. Check for mistakes.
with:
node-version: ${{ matrix.node }}
- run: npm ci --production
- run: npm install --production
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is now inaccurate. The job has been changed to use npm install --production instead of npm ci --production, but the comment still references the old command. Update the comment to reflect the actual command being used.

Copilot uses AI. Check for mistakes.
Comment on lines +70 to +76
- name: Cache/Restore node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caching strategy is incomplete. After restoring the cache, the workflow should check if the cache was hit and only run npm install when the cache misses. Without this check, npm install will run every time, which defeats the purpose of caching. Add a condition like if: steps.node-modules-cache.outputs.cache-hit != 'true' to the npm install step.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +118
- name: Cache/Restore node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caching strategy is incomplete. After restoring the cache, the workflow should check if the cache was hit and only run npm install when the cache misses. Without this check, npm install will run every time, which defeats the purpose of caching. Add a condition like if: steps.node-modules-cache.outputs.cache-hit != 'true' to the npm install step.

Copilot uses AI. Check for mistakes.
# As a lot of dev dependencies are not supported on ARMv7, we have to test it separately and just test if `npm ci --production` works
armv7-simple-test:
needs: [ ]
needs: [ e2e-test ]
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the dependency chain creates a problematic workflow sequence. The armv7-simple-test job now depends on e2e-test, which depends on check-linters. This means the armv7 test must wait for both linters and e2e tests to complete before running, which significantly increases CI time and prevents parallel execution. Consider whether this dependency is necessary or if jobs should run in parallel.

Suggested change
needs: [ e2e-test ]

Copilot uses AI. Check for mistakes.
needs: [ check-linters ]
runs-on: ARM64
env:
PLAYWRIGHT_VERSION: ~1.39.0
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tilde version specifier ~1.39.0 in Playwright version will only match patch updates (1.39.x) but this version is quite old. Playwright 1.39 was released in late 2023. Consider using a more recent version or a caret specifier (^1.39.0) to allow minor updates, or specify the exact version if stability is critical.

Suggested change
PLAYWRIGHT_VERSION: ~1.39.0
PLAYWRIGHT_VERSION: ^1.49.0

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +127
- name: Install Playwright ${{ env.PLAYWRIGHT_VERSION }}
run: npx playwright@${{ env.PLAYWRIGHT_VERSION }} install
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Playwright installation command is incorrect. Using npx playwright@${{ env.PLAYWRIGHT_VERSION }} install installs the Playwright browsers for the specified version, but it doesn't install the Playwright package itself at that version. This command should be run after npm install (which already installs Playwright from package.json), or you should use npx playwright install without the version specifier since the version is already controlled by package.json.

Copilot uses AI. Check for mistakes.
needs: [ ]
runs-on: ubuntu-24.04-arm
needs: [ check-linters ]
runs-on: ARM64
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runner label ARM64 may not be a valid GitHub-hosted runner. GitHub's standard hosted runners are labels like ubuntu-latest, ubuntu-24.04, macos-latest, etc. The previous value ubuntu-24.04-arm was more specific. Verify that ARM64 is a valid self-hosted runner label in your organization, otherwise this job will fail to find a runner.

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +96
- name: Cache/Restore node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caching strategy is incomplete. After restoring the cache, the workflow should check if the cache was hit and only run npm install when the cache misses. Without this check, npm install will run every time, which defeats the purpose of caching. Add a condition like if: steps.node-modules-cache.outputs.cache-hit != 'true' to the npm install step.

Copilot uses AI. Check for mistakes.
jobs:
auto-test:
needs: [ check-linters ]
needs: [ e2e-test ]
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the dependency chain creates a circular dependency problem. The auto-test job now depends on e2e-test, but e2e-test depends on check-linters. This means all tests must wait for e2e-test to complete before running, which significantly increases CI time and prevents parallel execution. Consider whether this dependency is necessary or if jobs should run in parallel.

Suggested change
needs: [ e2e-test ]

Copilot uses AI. Check for mistakes.
@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated tests are failing

3 participants