Skip to content

fix(e2e): detect and use correct package manager (npm vs pnpm)#146

Open
privilegedescalation-engineer[bot] wants to merge 1 commit intomainfrom
hugh/fix-e2e-package-manager-detection
Open

fix(e2e): detect and use correct package manager (npm vs pnpm)#146
privilegedescalation-engineer[bot] wants to merge 1 commit intomainfrom
hugh/fix-e2e-package-manager-detection

Conversation

@privilegedescalation-engineer
Copy link
Copy Markdown
Contributor

Summary

Fix E2E workflow to detect and use the correct package manager (npm vs pnpm). Previously always used npm ci which fails on pnpm-managed repos.

Problem

E2E tests consistently failing across all Headlamp plugin repos because plugin-e2e.yaml unconditionally runs npm ci. Many plugins use pnpm (kube-vip, rook, argocd, tns-csi, etc.) which cannot be installed via npm ci.

Solution

Mirror the package manager detection logic already present in plugin-ci.yaml:

  1. Detect package manager (check for pnpm-lock.yaml)
  2. For pnpm repos: use corepack enable pnpm + pnpm install
  3. For npm repos: use npm ci

Additional improvements

  • Add pnpm store caching for faster installs
  • Split Install dependencies into npm/pnpm variants
  • Split Run E2E tests into npm/pnpm variants

Testing

Once merged, update all plugin repos to change workflow ref from hugh/add-pnpm-support-plugin-e2e to main.

Previously the E2E workflow always used 'npm ci' regardless of which
package manager the plugin repo actually uses. This caused E2E tests to
fail on pnpm-managed repos because 'npm ci' cannot install from
pnpm-lock.yaml.

Add 'Detect package manager' step and conditional install/setup:
- For npm repos: npm ci
- For pnpm repos: corepack-based pnpm install (respecting packageManager field)

Also add pnpm store caching for faster installs.
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.

1 participant