Skip to content

Commit

Permalink
Why does this fail on Ubuntu?
Browse files Browse the repository at this point in the history
  • Loading branch information
badeball committed Sep 28, 2024
1 parent 80226ec commit 934410b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 223 deletions.
28 changes: 7 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,14 @@ concurrency:
cancel-in-progress: true

jobs:
prepare-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set-matrix
name: Prepare
run: echo "matrix=$(node -p "JSON.stringify(require('./package.json').peerDependencies['cypress'].split(' || '))")" >> $GITHUB_OUTPUT
- run: npm -v

test:
needs: prepare-versions
runs-on: ubuntu-latest
container:
image: cypress/browsers:latest
strategy:
fail-fast: false
matrix:
cypress-version: ${{fromJson(needs.prepare-versions.outputs.matrix)}}
cypress-version: ["13"]
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -56,7 +43,9 @@ jobs:
- name: Build
run: npm run build
- name: Test
run: npm run test
env:
DEBUG: cypress:electron,cypress-configuration,cypress-cucumber-preprocessor
run: npm run test:integration -- features/reporters/usage.feature:91
- name: Versions
run: |
npx cypress --version
Expand Down Expand Up @@ -93,9 +82,6 @@ jobs:
- name: Remove Webpack test
run: rm features/loaders/webpack.feature
- name: Test
run: npm run test:integration
- name: Versions
run: |
npx cypress --version
node --version
npm --version
env:
DEBUG: cypress:electron,cypress-configuration,cypress-cucumber-preprocessor
run: npm run test:integration -- features/reporters/usage.feature:91
118 changes: 0 additions & 118 deletions .github/workflows/examples-branch.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/examples-master.yml

This file was deleted.

18 changes: 6 additions & 12 deletions lib/subpath-entrypoints/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ import { assertAndReturn } from "../helpers/assertions";

import debug from "../helpers/debug";

const exists = (path: string) =>
fs.access(path).then(
() => true,
() => false,
);

export function createEsbuildPlugin(
configuration: Cypress.PluginConfigOptions,
options: { prettySourceMap: boolean } = { prettySourceMap: false },
Expand All @@ -39,13 +33,10 @@ export function createEsbuildPlugin(
(await fs.readFile(sourceMapLocation)).toString(),
);

const lastSource = sourceMap.sources[sourceMap.sources.length - 1];

const isRelativeToProjectRoot = (file: string) =>
exists(path.join(configuration.projectRoot, file));
const lastSource: string | undefined =
sourceMap.sources[sourceMap.sources.length - 1];

const needPrettify =
lastSource != null && !(await isRelativeToProjectRoot(lastSource));
const needPrettify = lastSource?.startsWith("../") ?? false;

/**
* There are numerous issues regarding the sources property in esbuild, particularly when
Expand Down Expand Up @@ -80,6 +71,9 @@ export function createEsbuildPlugin(
debug("esbuild: using original sources");
}

// debug("sources after (all)", sourceMap.sources);
debug("sources after (last)", sourceMap.sources.slice(-5));

await fs.rm(sourceMapLocation);

const encoded = Buffer.from(JSON.stringify(sourceMap)).toString(
Expand Down

0 comments on commit 934410b

Please sign in to comment.