Skip to content

Commit 08c98cf

Browse files
authored
fix(e2e): resolve flaky Camoufox tests due to GitHub rate limits (apify#3527)
Fixes apify#3524 Bumps `camoufox-js` to 0.9.3 which supports `GITHUB_TOKEN` for authenticated GitHub API requests (5000 req/hour vs 60 unauthenticated). The ephemeral action token is now passed in the e2e workflow. Switches Camoufox Dockerfiles to the new `apify/actor-node-playwright-camoufox` base image with Camoufox preinstalled, removing the need to fetch binaries during Docker builds entirely.
1 parent b2296ce commit 08c98cf

6 files changed

Lines changed: 92 additions & 78 deletions

File tree

.github/workflows/test-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ jobs:
7575
STORAGE_IMPLEMENTATION: ${{ matrix.storage }}
7676
APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }}
7777
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
78+
GITHUB_TOKEN: ${{ github.token }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"apify-node-curl-impersonate": "^1.0.15",
8888
"basic-auth-parser": "^0.0.2",
8989
"body-parser": "^2.0.0",
90-
"camoufox-js": "^0.9.0",
90+
"camoufox-js": "^0.9.3",
9191
"commitlint": "^20.0.0",
9292
"cross-env": "^10.0.0",
9393
"deep-equal": "^2.0.5",

packages/templates/templates/camoufox-ts/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Specify the base Docker image. You can read more about
22
# the available images at https://crawlee.dev/docs/guides/docker-images
33
# You can also use any other image from Docker Hub.
4-
FROM apify/actor-node-playwright-chrome:20-1.50.1 AS builder
4+
FROM apify/actor-node-playwright-camoufox:20-1.50.1 AS builder
55

66
# Copy just package.json and package-lock.json
77
# to speed up the build using Docker layer cache.
@@ -19,7 +19,7 @@ COPY --chown=myuser . ./
1919
RUN npm run build
2020

2121
# Create final image
22-
FROM apify/actor-node-playwright-chrome:20-1.50.1
22+
FROM apify/actor-node-playwright-camoufox:20-1.50.1
2323

2424
# Copy only built JS files from builder image
2525
COPY --from=builder --chown=myuser /home/myuser/dist ./dist
@@ -28,8 +28,6 @@ COPY --from=builder --chown=myuser /home/myuser/dist ./dist
2828
# to speed up the build using Docker layer cache.
2929
COPY --chown=myuser package*.json ./
3030

31-
# Ensure we'll install Camoufox using the npm postinstall script
32-
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
3331
# Install NPM packages, skip optional and development dependencies to
3432
# keep the image small. Avoid logging too much and print the dependency
3533
# tree for debugging

test/e2e/camoufox-cloudflare/actor/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
FROM apify/actor-node-playwright-chrome:20-1.50.1-beta AS builder
1+
FROM apify/actor-node-playwright-camoufox:20-1.50.1-beta AS builder
22

33
COPY /packages ./packages
44
COPY /package*.json ./
55
RUN npm --quiet set progress=false \
66
&& npm install --only=prod --no-optional --no-audit --ignore-scripts \
77
&& npm update
88

9-
FROM apify/actor-node-playwright-chrome:20-1.50.1-beta
9+
FROM apify/actor-node-playwright-camoufox:20-1.50.1-beta
1010

1111
RUN rm -r node_modules
1212
COPY --from=builder /node_modules ./node_modules
13-
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
14-
RUN npm run postinstall
1513
COPY --from=builder /packages ./packages
1614
COPY --from=builder /package*.json ./
1715
COPY /.actor ./.actor

test/e2e/camoufox-cloudflare/actor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@crawlee/playwright": "file:./packages/playwright-crawler",
1414
"@crawlee/types": "file:./packages/types",
1515
"@crawlee/utils": "file:./packages/utils",
16-
"camoufox-js": "^0.2.1",
16+
"camoufox-js": "^0.9.3",
1717
"playwright": "*"
1818
},
1919
"overrides": {

yarn.lock

Lines changed: 85 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ __metadata:
10911091
apify-node-curl-impersonate: "npm:^1.0.15"
10921092
basic-auth-parser: "npm:^0.0.2"
10931093
body-parser: "npm:^2.0.0"
1094-
camoufox-js: "npm:^0.9.0"
1094+
camoufox-js: "npm:^0.9.3"
10951095
commitlint: "npm:^20.0.0"
10961096
cross-env: "npm:^10.0.0"
10971097
deep-equal: "npm:^2.0.5"
@@ -4969,26 +4969,27 @@ __metadata:
49694969
languageName: node
49704970
linkType: hard
49714971

4972-
"camoufox-js@npm:^0.9.0":
4973-
version: 0.9.1
4974-
resolution: "camoufox-js@npm:0.9.1"
4972+
"camoufox-js@npm:^0.9.3":
4973+
version: 0.9.3
4974+
resolution: "camoufox-js@npm:0.9.3"
49754975
dependencies:
49764976
adm-zip: "npm:^0.5.16"
49774977
better-sqlite3: "npm:^12.2.0"
4978+
cli-progress: "npm:^3.12.0"
49784979
commander: "npm:^14.0.0"
49794980
fingerprint-generator: "npm:^2.1.66"
49804981
glob: "npm:^13.0.0"
4981-
impit: "npm:^0.9.0"
4982+
impit: "npm:^0.11.0"
49824983
language-tags: "npm:^2.0.1"
49834984
maxmind: "npm:^5.0.0"
4984-
progress: "npm:^2.0.3"
4985+
pretty-bytes: "npm:^7.1.0"
49854986
ua-parser-js: "npm:^2.0.2"
49864987
xml2js: "npm:^0.6.2"
49874988
peerDependencies:
49884989
playwright-core: "*"
49894990
bin:
49904991
camoufox-js: dist/__main__.js
4991-
checksum: 10c0/1dc6dd49b5e58930c5fc9cccd9f72e4040b39d348b139aa9c0b1ff95847ba8d85aff25d56e7643d0eb3ec98a9ed66c92814ad0a81a197ed6c84223519b4332f7
4992+
checksum: 10c0/3ddb0176cee0e7f6b8eda61fb1290a549fb683b5e5ee7e07d3f3123751899b2a3ce821acffa3a34d5300124e1b5da02c6e3769c50a8e7e8aafe10538d3ec38c6
49924993
languageName: node
49934994
linkType: hard
49944995

@@ -5192,6 +5193,15 @@ __metadata:
51925193
languageName: node
51935194
linkType: hard
51945195

5196+
"cli-progress@npm:^3.12.0":
5197+
version: 3.12.0
5198+
resolution: "cli-progress@npm:3.12.0"
5199+
dependencies:
5200+
string-width: "npm:^4.2.3"
5201+
checksum: 10c0/f464cb19ebde2f3880620a2adfaeeefaec6cb15c8e610c8a659ca1047ee90d69f3bf2fdabbb1fe33ac408678e882e3e0eecdb84ab5df0edf930b269b8a72682d
5202+
languageName: node
5203+
linkType: hard
5204+
51955205
"cli-spinners@npm:2.6.1":
51965206
version: 2.6.1
51975207
resolution: "cli-spinners@npm:2.6.1"
@@ -8474,17 +8484,24 @@ __metadata:
84748484
languageName: node
84758485
linkType: hard
84768486

8487+
"impit-darwin-arm64@npm:0.11.0":
8488+
version: 0.11.0
8489+
resolution: "impit-darwin-arm64@npm:0.11.0"
8490+
conditions: os=darwin & cpu=arm64
8491+
languageName: node
8492+
linkType: hard
8493+
84778494
"impit-darwin-arm64@npm:0.12.0":
84788495
version: 0.12.0
84798496
resolution: "impit-darwin-arm64@npm:0.12.0"
84808497
conditions: os=darwin & cpu=arm64
84818498
languageName: node
84828499
linkType: hard
84838500

8484-
"impit-darwin-arm64@npm:0.9.0":
8485-
version: 0.9.0
8486-
resolution: "impit-darwin-arm64@npm:0.9.0"
8487-
conditions: os=darwin & cpu=arm64
8501+
"impit-darwin-x64@npm:0.11.0":
8502+
version: 0.11.0
8503+
resolution: "impit-darwin-x64@npm:0.11.0"
8504+
conditions: os=darwin & cpu=x64
84888505
languageName: node
84898506
linkType: hard
84908507

@@ -8495,10 +8512,10 @@ __metadata:
84958512
languageName: node
84968513
linkType: hard
84978514

8498-
"impit-darwin-x64@npm:0.9.0":
8499-
version: 0.9.0
8500-
resolution: "impit-darwin-x64@npm:0.9.0"
8501-
conditions: os=darwin & cpu=x64
8515+
"impit-linux-arm64-gnu@npm:0.11.0":
8516+
version: 0.11.0
8517+
resolution: "impit-linux-arm64-gnu@npm:0.11.0"
8518+
conditions: os=linux & cpu=arm64 & libc=glibc
85028519
languageName: node
85038520
linkType: hard
85048521

@@ -8509,10 +8526,10 @@ __metadata:
85098526
languageName: node
85108527
linkType: hard
85118528

8512-
"impit-linux-arm64-gnu@npm:0.9.0":
8513-
version: 0.9.0
8514-
resolution: "impit-linux-arm64-gnu@npm:0.9.0"
8515-
conditions: os=linux & cpu=arm64 & libc=glibc
8529+
"impit-linux-arm64-musl@npm:0.11.0":
8530+
version: 0.11.0
8531+
resolution: "impit-linux-arm64-musl@npm:0.11.0"
8532+
conditions: os=linux & cpu=arm64 & libc=musl
85168533
languageName: node
85178534
linkType: hard
85188535

@@ -8523,10 +8540,10 @@ __metadata:
85238540
languageName: node
85248541
linkType: hard
85258542

8526-
"impit-linux-arm64-musl@npm:0.9.0":
8527-
version: 0.9.0
8528-
resolution: "impit-linux-arm64-musl@npm:0.9.0"
8529-
conditions: os=linux & cpu=arm64 & libc=musl
8543+
"impit-linux-x64-gnu@npm:0.11.0":
8544+
version: 0.11.0
8545+
resolution: "impit-linux-x64-gnu@npm:0.11.0"
8546+
conditions: os=linux & cpu=x64 & libc=glibc
85308547
languageName: node
85318548
linkType: hard
85328549

@@ -8537,10 +8554,10 @@ __metadata:
85378554
languageName: node
85388555
linkType: hard
85398556

8540-
"impit-linux-x64-gnu@npm:0.9.0":
8541-
version: 0.9.0
8542-
resolution: "impit-linux-x64-gnu@npm:0.9.0"
8543-
conditions: os=linux & cpu=x64 & libc=glibc
8557+
"impit-linux-x64-musl@npm:0.11.0":
8558+
version: 0.11.0
8559+
resolution: "impit-linux-x64-musl@npm:0.11.0"
8560+
conditions: os=linux & cpu=x64 & libc=musl
85448561
languageName: node
85458562
linkType: hard
85468563

@@ -8551,10 +8568,10 @@ __metadata:
85518568
languageName: node
85528569
linkType: hard
85538570

8554-
"impit-linux-x64-musl@npm:0.9.0":
8555-
version: 0.9.0
8556-
resolution: "impit-linux-x64-musl@npm:0.9.0"
8557-
conditions: os=linux & cpu=x64 & libc=musl
8571+
"impit-win32-arm64-msvc@npm:0.11.0":
8572+
version: 0.11.0
8573+
resolution: "impit-win32-arm64-msvc@npm:0.11.0"
8574+
conditions: os=win32 & cpu=arm64
85588575
languageName: node
85598576
linkType: hard
85608577

@@ -8565,10 +8582,10 @@ __metadata:
85658582
languageName: node
85668583
linkType: hard
85678584

8568-
"impit-win32-arm64-msvc@npm:0.9.0":
8569-
version: 0.9.0
8570-
resolution: "impit-win32-arm64-msvc@npm:0.9.0"
8571-
conditions: os=win32 & cpu=arm64
8585+
"impit-win32-x64-msvc@npm:0.11.0":
8586+
version: 0.11.0
8587+
resolution: "impit-win32-x64-msvc@npm:0.11.0"
8588+
conditions: os=win32 & cpu=x64
85728589
languageName: node
85738590
linkType: hard
85748591

@@ -8579,25 +8596,18 @@ __metadata:
85798596
languageName: node
85808597
linkType: hard
85818598

8582-
"impit-win32-x64-msvc@npm:0.9.0":
8583-
version: 0.9.0
8584-
resolution: "impit-win32-x64-msvc@npm:0.9.0"
8585-
conditions: os=win32 & cpu=x64
8586-
languageName: node
8587-
linkType: hard
8588-
8589-
"impit@npm:^0.12.0":
8590-
version: 0.12.0
8591-
resolution: "impit@npm:0.12.0"
8592-
dependencies:
8593-
impit-darwin-arm64: "npm:0.12.0"
8594-
impit-darwin-x64: "npm:0.12.0"
8595-
impit-linux-arm64-gnu: "npm:0.12.0"
8596-
impit-linux-arm64-musl: "npm:0.12.0"
8597-
impit-linux-x64-gnu: "npm:0.12.0"
8598-
impit-linux-x64-musl: "npm:0.12.0"
8599-
impit-win32-arm64-msvc: "npm:0.12.0"
8600-
impit-win32-x64-msvc: "npm:0.12.0"
8599+
"impit@npm:^0.11.0":
8600+
version: 0.11.0
8601+
resolution: "impit@npm:0.11.0"
8602+
dependencies:
8603+
impit-darwin-arm64: "npm:0.11.0"
8604+
impit-darwin-x64: "npm:0.11.0"
8605+
impit-linux-arm64-gnu: "npm:0.11.0"
8606+
impit-linux-arm64-musl: "npm:0.11.0"
8607+
impit-linux-x64-gnu: "npm:0.11.0"
8608+
impit-linux-x64-musl: "npm:0.11.0"
8609+
impit-win32-arm64-msvc: "npm:0.11.0"
8610+
impit-win32-x64-msvc: "npm:0.11.0"
86018611
dependenciesMeta:
86028612
impit-darwin-arm64:
86038613
optional: true
@@ -8615,22 +8625,22 @@ __metadata:
86158625
optional: true
86168626
impit-win32-x64-msvc:
86178627
optional: true
8618-
checksum: 10c0/24ec37b53554aedcf1438b9eca75191043732eec66f9acf29b6098a1fc3bce2ffa8aaa808090b1588d486101043eb89f4cfe933e2095b10e79179b6a0c9ecd8b
8628+
checksum: 10c0/dbe0286280b63f0772e9359c39be975b8348fab7b470404afc8fff6ca9f2069f29ddd550fc7237b34dad04f0fbfa6028f87a744c040c03db06771573610cbf19
86198629
languageName: node
86208630
linkType: hard
86218631

8622-
"impit@npm:^0.9.0":
8623-
version: 0.9.0
8624-
resolution: "impit@npm:0.9.0"
8625-
dependencies:
8626-
impit-darwin-arm64: "npm:0.9.0"
8627-
impit-darwin-x64: "npm:0.9.0"
8628-
impit-linux-arm64-gnu: "npm:0.9.0"
8629-
impit-linux-arm64-musl: "npm:0.9.0"
8630-
impit-linux-x64-gnu: "npm:0.9.0"
8631-
impit-linux-x64-musl: "npm:0.9.0"
8632-
impit-win32-arm64-msvc: "npm:0.9.0"
8633-
impit-win32-x64-msvc: "npm:0.9.0"
8632+
"impit@npm:^0.12.0":
8633+
version: 0.12.0
8634+
resolution: "impit@npm:0.12.0"
8635+
dependencies:
8636+
impit-darwin-arm64: "npm:0.12.0"
8637+
impit-darwin-x64: "npm:0.12.0"
8638+
impit-linux-arm64-gnu: "npm:0.12.0"
8639+
impit-linux-arm64-musl: "npm:0.12.0"
8640+
impit-linux-x64-gnu: "npm:0.12.0"
8641+
impit-linux-x64-musl: "npm:0.12.0"
8642+
impit-win32-arm64-msvc: "npm:0.12.0"
8643+
impit-win32-x64-msvc: "npm:0.12.0"
86348644
dependenciesMeta:
86358645
impit-darwin-arm64:
86368646
optional: true
@@ -8648,7 +8658,7 @@ __metadata:
86488658
optional: true
86498659
impit-win32-x64-msvc:
86508660
optional: true
8651-
checksum: 10c0/52c777a3c2a62492690bd9cd21a2d7cd22fcece51284d26efc76727692b10636c2e3072e8cdb6c7a4de7e5edd016ad1f8a8d8ecba7afdf7f43d14d0c4d434df2
8661+
checksum: 10c0/24ec37b53554aedcf1438b9eca75191043732eec66f9acf29b6098a1fc3bce2ffa8aaa808090b1588d486101043eb89f4cfe933e2095b10e79179b6a0c9ecd8b
86528662
languageName: node
86538663
linkType: hard
86548664

@@ -12233,6 +12243,13 @@ __metadata:
1223312243
languageName: node
1223412244
linkType: hard
1223512245

12246+
"pretty-bytes@npm:^7.1.0":
12247+
version: 7.1.0
12248+
resolution: "pretty-bytes@npm:7.1.0"
12249+
checksum: 10c0/9458f17007bbf8b61d11ef82091bfe7f87bb2f3fd7e6aa917744eb6dc709346995f698ecbf6597ac353b0d44bb7982054f7a2325f3260c9909d09aaafbdab5ca
12250+
languageName: node
12251+
linkType: hard
12252+
1223612253
"pretty-format@npm:30.2.0":
1223712254
version: 30.2.0
1223812255
resolution: "pretty-format@npm:30.2.0"

0 commit comments

Comments
 (0)