Skip to content

Commit 11f2fde

Browse files
committed
Why does this fail on Ubuntu?
1 parent 80226ec commit 11f2fde

File tree

4 files changed

+15
-222
lines changed

4 files changed

+15
-222
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,14 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
prepare-versions:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
matrix: ${{ steps.set-matrix.outputs.matrix }}
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
- id: set-matrix
18-
name: Prepare
19-
run: echo "matrix=$(node -p "JSON.stringify(require('./package.json').peerDependencies['cypress'].split(' || '))")" >> $GITHUB_OUTPUT
20-
- run: npm -v
21-
2210
test:
23-
needs: prepare-versions
2411
runs-on: ubuntu-latest
2512
container:
2613
image: cypress/browsers:latest
2714
strategy:
2815
fail-fast: false
2916
matrix:
30-
cypress-version: ${{fromJson(needs.prepare-versions.outputs.matrix)}}
17+
cypress-version: ["13"]
3118
steps:
3219
- uses: actions/setup-node@v4
3320
with:
@@ -56,7 +43,9 @@ jobs:
5643
- name: Build
5744
run: npm run build
5845
- name: Test
59-
run: npm run test
46+
env:
47+
DEBUG: cypress:electron,cypress-configuration,cypress-cucumber-preprocessor
48+
run: npm run test:integration -- features/reporters/usage.feature:91
6049
- name: Versions
6150
run: |
6251
npx cypress --version
@@ -93,9 +82,6 @@ jobs:
9382
- name: Remove Webpack test
9483
run: rm features/loaders/webpack.feature
9584
- name: Test
96-
run: npm run test:integration
97-
- name: Versions
98-
run: |
99-
npx cypress --version
100-
node --version
101-
npm --version
85+
env:
86+
DEBUG: cypress:electron,cypress-configuration,cypress-cucumber-preprocessor
87+
run: npm run test:integration -- features/reporters/usage.feature:91

.github/workflows/examples-branch.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.

.github/workflows/examples-master.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

lib/subpath-entrypoints/esbuild.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ import { assertAndReturn } from "../helpers/assertions";
1010

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

13-
const exists = (path: string) =>
14-
fs.access(path).then(
15-
() => true,
16-
() => false,
17-
);
18-
1913
export function createEsbuildPlugin(
2014
configuration: Cypress.PluginConfigOptions,
2115
options: { prettySourceMap: boolean } = { prettySourceMap: false },
@@ -39,13 +33,13 @@ export function createEsbuildPlugin(
3933
(await fs.readFile(sourceMapLocation)).toString(),
4034
);
4135

42-
const lastSource = sourceMap.sources[sourceMap.sources.length - 1];
43-
44-
const isRelativeToProjectRoot = (file: string) =>
45-
exists(path.join(configuration.projectRoot, file));
36+
const lastSource: string | undefined =
37+
sourceMap.sources[sourceMap.sources.length - 1];
4638

4739
const needPrettify =
48-
lastSource != null && !(await isRelativeToProjectRoot(lastSource));
40+
lastSource?.startsWith(
41+
path.relative(path.dirname(outfile), configuration.projectRoot),
42+
) ?? false;
4943

5044
/**
5145
* There are numerous issues regarding the sources property in esbuild, particularly when
@@ -80,6 +74,9 @@ export function createEsbuildPlugin(
8074
debug("esbuild: using original sources");
8175
}
8276

77+
// debug("sources after (all)", sourceMap.sources);
78+
debug("sources after (last)", sourceMap.sources.slice(-5));
79+
8380
await fs.rm(sourceMapLocation);
8481

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

0 commit comments

Comments
 (0)