Skip to content

include tests/e2e in pnpm workspace for shared tooling#1084

Closed
NilukaSripalim wants to merge 14 commits intoasgardeo:mainfrom
NilukaSripalim:modification01
Closed

include tests/e2e in pnpm workspace for shared tooling#1084
NilukaSripalim wants to merge 14 commits intoasgardeo:mainfrom
NilukaSripalim:modification01

Conversation

@NilukaSripalim
Copy link
Contributor

Purpose

This PR adds the tests/e2e folder to the existing pnpm workspace so it can reuse shared tools such as linters, Prettier, and other common dependencies. This helps keep tooling consistent across the project and avoids managing duplicate configurations.


⚠️ Breaking Changes

🔧 Summary of Breaking Changes

Describe what is changing

💥 Impact

What will break? Who is affected?

🔄 Migration Guide

How should users update their code/configuration to adapt to the breaking changes? Include examples if helpful


-->

Approach

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Copy link
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 integrates the tests/e2e folder into the existing pnpm workspace to leverage shared tooling such as ESLint configurations, Prettier settings, and common dependencies from the @thunder packages. This consolidation helps maintain consistency across the project and avoids duplicate tool configurations.

Changes:

  • Added tests/e2e to the pnpm workspace configuration
  • Updated e2e test dependencies to use workspace packages and catalog versions
  • Replaced custom ESLint rules with shared Thunder ESLint plugin configuration

Reviewed changes

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

File Description
frontend/pnpm-workspace.yaml Adds tests/e2e to the workspace using a relative path
tests/e2e/package.json Replaces hardcoded versions with workspace dependencies and catalog references
tests/e2e/eslint.config.mjs Imports and uses shared Thunder ESLint plugin, removing duplicate rule definitions

import tsParser from "@typescript-eslint/parser";

export default [
...thunderPlugin.configs.typescript,
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The Thunder ESLint plugin does not export a typescript config. Based on the plugin's source code, only base and react configs are available. Since this is a test project without React components, use ...thunderPlugin.configs.base instead.

Suggested change
...thunderPlugin.configs.typescript,
...thunderPlugin.configs.base,

Copilot uses AI. Check for mistakes.
Comment on lines 12 to 14
plugins: {
"@typescript-eslint": typescriptEslint,
playwright: playwright,
},
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The @typescript-eslint plugin has been removed from the plugins object, but the languageOptions still reference the TypeScript parser. Since the Thunder base config already includes TypeScript support, verify that the parser and parserOptions configuration from lines 15-21 is necessary or if it can be simplified to avoid conflicting with the shared config.

Copilot uses AI. Check for mistakes.
@NilukaSripalim NilukaSripalim added the skip-changelog Skip generating changelog for a particular PR label Jan 15, 2026
pavinduLakshan
pavinduLakshan previously approved these changes Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.76%. Comparing base (5846107) to head (9c0eed9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1084      +/-   ##
==========================================
- Coverage   86.78%   86.76%   -0.02%     
==========================================
  Files         526      526              
  Lines       35078    35078              
  Branches     1611     1611              
==========================================
- Hits        30441    30436       -5     
- Misses       2930     2936       +6     
+ Partials     1707     1706       -1     
Flag Coverage Δ
backend-integration-postgres 55.45% <ø> (ø)
backend-integration-sqlite 55.42% <ø> (ø)
backend-unit 77.96% <ø> (+0.01%) ⬆️
frontend-apps-develop-unit 80.87% <ø> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings January 15, 2026 14:19
Copy link
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

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

Comment on lines 307 to 313
- name: � Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false

- name: �📥 Download Built Distribution
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The emoji character appears corrupted or not properly encoded. Should be a package/box emoji like 📦.

Suggested change
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📥 Download Built Distribution
- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📦📥 Download Built Distribution

Copilot uses AI. Check for mistakes.
Comment on lines 307 to 313
- name: � Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false

- name: �📥 Download Built Distribution
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The emoji character appears corrupted or not properly encoded. Should be a single emoji.

Suggested change
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📥 Download Built Distribution
- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📥 Download Built Distribution

Copilot uses AI. Check for mistakes.
Comment on lines 42 to 43
"@typescript-eslint/eslint-plugin": "8.0.0",
"@typescript-eslint/parser": "8.0.0",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

These TypeScript-ESLint dependencies appear to be redundant since the workspace package @thunder/eslint-plugin-thunder already includes TypeScript-ESLint support in its configs.base. Consider removing these dependencies as they're already provided transitively through the shared plugin.

Suggested change
"@typescript-eslint/eslint-plugin": "8.0.0",
"@typescript-eslint/parser": "8.0.0",

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 15:04
Copy link
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

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

Comment on lines 38 to 39
"@thunder/eslint-plugin-thunder": "workspace:^",
"@thunder/prettier-config": "workspace:^",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The package.json now references the shared @thunder/prettier-config package, but the existing .prettierrc.json file should be replaced with a prettier.config.js file that imports this shared config (similar to how frontend/apps/thunder-gate/prettier.config.js uses it). The .prettierrc.json file uses different configuration values (e.g., singleQuote: false vs true, arrowParens: avoid vs always) which will cause inconsistency.

Copilot uses AI. Check for mistakes.
@@ -1,42 +1,17 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import thunderPlugin from "@thunder/eslint-plugin-thunder";
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The new eslint.config.mjs migrates to use the shared Thunder ESLint plugin, but the old .eslintrc.json file still exists in the tests/e2e directory. This should be removed to avoid configuration conflicts and confusion about which ESLint config is active.

Copilot uses AI. Check for mistakes.
Comment on lines 38 to 39
"@thunder/eslint-plugin-thunder": "workspace:^",
"@thunder/prettier-config": "workspace:^",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Since the project is now using pnpm workspace and the package-lock.json was generated by npm, the package-lock.json file in tests/e2e directory should be removed and replaced with pnpm-lock.yaml at the workspace root level (frontend/pnpm-lock.yaml) after running 'pnpm install'.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 15:27
Copy link
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment on lines 480 to 487
env:
NODE_PATH: ../../node_modules

- name: Run Playwright tests
- name: 🎭 Run Playwright Tests
run: npx playwright test
working-directory: tests/e2e
env:
NODE_PATH: ../../node_modules
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The NODE_PATH environment variable may not be necessary since tests/e2e is now part of the pnpm workspace. pnpm manages node_modules resolution through symlinks automatically. Verify if NODE_PATH is actually required for proper module resolution, or if it can be removed for cleaner configuration.

Copilot uses AI. Check for mistakes.
Comment on lines 307 to 313
- name: � Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false

- name: �📥 Download Built Distribution
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The step name contains a corrupted/invisible character. The emoji should be properly displayed. Check the encoding of this line.

Suggested change
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: �📥 Download Built Distribution
- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📦 Download Built Distribution

Copilot uses AI. Check for mistakes.
Comment on lines 307 to 313
- name: � Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false

- name: �📥 Download Built Distribution
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The step name contains corrupted/invisible characters at the beginning. The emoji should be properly displayed. Check the encoding of this line.

Suggested change
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📥 Download Built Distribution
- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9.x'
run_install: false
- name: 📥 Download Built Distribution

Copilot uses AI. Check for mistakes.
@@ -1,42 +1,17 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import thunderPlugin from "@thunder/eslint-plugin-thunder";
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The old .eslintrc.json file should be removed since the configuration has been migrated to eslint.config.mjs. Having both configuration files can cause confusion and conflicts.

Copilot uses AI. Check for mistakes.
@@ -1,42 +1,17 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import thunderPlugin from "@thunder/eslint-plugin-thunder";
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The .prettierrc.json file should be removed or replaced with a prettier.config.js that imports the shared @thunder/prettier-config package. Having a local .prettierrc.json file will override the shared configuration and defeat the purpose of centralizing tooling configuration. Create a prettier.config.js file similar to the one in frontend/prettier.config.js that imports from "@thunder/prettier-config".

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 16:25
Copy link
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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • tests/e2e/package-lock.json: Language not supported
  • tests/e2e/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/pr-builder.yml:1

  • The step name contains a corrupted emoji character '�' before 'Install pnpm'. This should be cleaned up.
# This workflow will build the project on pull requests with tests

"node",
"@playwright/test"
],
"moduleResolution": "node",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The change from moduleResolution: 'bundler' to 'node' may cause module resolution issues if the E2E tests were previously relying on bundler-specific resolution patterns. This change should be verified with the actual test execution to ensure all imports still resolve correctly.

Suggested change
"moduleResolution": "node",
"moduleResolution": "bundler",

Copilot uses AI. Check for mistakes.
Comment on lines 4 to 5


Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

An extra blank line was added without apparent purpose. While this doesn't affect functionality, it seems unintentional and should likely be removed to keep the file clean. Additionally, this file is in the frontend/ directory but the PR description mentions adding tests/e2e to the workspace - there's no visible change here that adds tests/e2e to any workspace configuration.

Suggested change
- ../tests/e2e

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 17:21
Copy link
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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • tests/e2e/package-lock.json: Language not supported
  • tests/e2e/pnpm-lock.yaml: Language not supported

Comment on lines 472 to 476
- name: ⚙️ Set up Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: '24.x'

Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Node.js is being set up twice in this workflow - once at line 305 with 'lts/*' and again here with '24.x'. This duplication is unnecessary and could cause confusion. Consider removing one of these steps or clarifying why different Node.js versions are needed at different stages.

Suggested change
- name: ⚙️ Set up Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: '24.x'

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 17:52
Copy link
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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • tests/e2e/package-lock.json: Language not supported
  • tests/e2e/pnpm-lock.yaml: Language not supported

Comment on lines +473 to 476
run: |
cd frontend
pnpm install --frozen-lockfile

Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The workflow installs dependencies from the frontend directory (which includes tests/e2e through the workspace), but then runs Playwright commands directly in tests/e2e. This creates an implicit dependency on the workspace installation happening in frontend/. Consider adding a comment explaining this workspace relationship, or verify that the working-directory for Playwright commands can access the node_modules from the workspace root.

Suggested change
run: |
cd frontend
pnpm install --frozen-lockfile
run: |
# Note: ./frontend is the pnpm workspace root. Running `pnpm install`
# here installs dependencies for all workspace packages, including
# the tests/e2e package used by the Playwright steps below.
cd frontend
pnpm install --frozen-lockfile
# Note: tests/e2e is part of the pnpm workspace rooted at ./frontend,
# so these Playwright commands rely on node_modules installed in the
# previous "Install E2E Dependencies" step.

Copilot uses AI. Check for mistakes.
"express": "^5.2.1",
"prettier": "3.4.2",
"typescript": "5.7.3"
"prettier": "3.6.2",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Prettier has been downgraded from 3.4.2 to 3.6.2, but version 3.6.2 is actually newer than 3.4.2. However, this creates a potential version mismatch if the workspace root or other packages use a different Prettier version. Since one goal of this PR is to share tooling across the workspace, consider removing this devDependency entirely and relying on the workspace's shared Prettier installation for consistency.

Suggested change
"prettier": "3.6.2",

Copilot uses AI. Check for mistakes.
@NilukaSripalim
Copy link
Contributor Author

With #1086, this flow has been updated in a more efficient way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skip generating changelog for a particular PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants