Skip to content

Commit 73b3f24

Browse files
authored
Puppeteer E2E test: Auto-download browser (#25380)
* Make Puppeteer autodownload browser * Update CONTRIBUTING.md * Fix indentation * Fix merge
1 parent f82a772 commit 73b3f24

File tree

8 files changed

+2510
-69
lines changed

8 files changed

+2510
-69
lines changed

.github/CONTRIBUTING.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contribution
22
## Introduction
33

4-
It is assumed that you know a little about node.js and git. If not, [here's some help to get started with git](https://help.github.com/en/github/using-git) and [here’s some help to get started with node.js.](https://nodejs.org/en/docs/guides/getting-started-guide/)
4+
It is assumed that you know a little about Node.js and Git. If not, [here's some help to get started with Git](https://help.github.com/en/github/using-git) and [here’s some help to get started with Node.js.](https://nodejs.org/en/docs/guides/getting-started-guide/)
55

66
* Install [Node.js](https://nodejs.org/)
77
* Install [Git](https://git-scm.com/)
@@ -26,25 +26,20 @@ As per the npm standard, ‘start’ is the place to begin the package.
2626

2727
npm start
2828

29-
This script will start a local server similar to [threejs.org](https://threejs.org/), but instead will be hosted on your local machine. Browse to http://localhost:8080/ to check it out. It also automatically creates the build/three.module.js script anytime there is a change within your three.js directory.
29+
This script will start a local server similar to [threejs.org](https://threejs.org/), but instead will be hosted on your local machine. Browse to https://localhost:8080/ to check it out. It also automatically creates the `build/three.module.js` script anytime there is a change `src` directory.
3030

31-
The next most important script runs all the appropriate testing. The E-2-E testing is intended to be run by GitHub Actions.
31+
Next scripts run all the appropriate testing.
3232

33-
Run this command from the root folder to install test dependencies.
34-
35-
npm install --prefix test
36-
37-
And run tests.
38-
39-
npm test
33+
- `npm run test` - Lint testing and unit testing (individually being `npm run lint` and `npm run test-unit`)
34+
- `npm run test-e2e` - E2E testing. This one can take quite a long time and installs ~200 MB Chromium browser - it is primarily intended to be run only by GitHub Actions
4035

4136
The linting is there to keep a consistent code style across all of the code and the testing is there to help catch bugs and check that the code behaves as expected. It is important that neither of these steps comes up with any errors due to your changes.
4237

43-
Many linting errors can be fixed automatically by running
38+
Most linting errors can be fixed automatically by running
4439

45-
npm lint-fix
40+
npm run lint-fix
4641

47-
If you’d like to make a minified version of the build files i.e. ‘build/three.min.js run:
42+
If you’d like to make a build of the source files (e.g. `build/three.module.js`) run:
4843

4944
npm run build
5045

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ jobs:
4545
node-version: 16
4646
cache: 'npm'
4747
- name: Install packages
48-
run: |
49-
npm ci
50-
npm ci --prefix test
48+
run: npm ci
5149
- name: Build
5250
run: npm run build
5351

@@ -73,9 +71,7 @@ jobs:
7371
node-version: 16
7472
cache: 'npm'
7573
- name: Install packages
76-
run: |
77-
npm ci
78-
npm ci --prefix test
74+
run: npm ci
7975
- name: Build
8076
run: npm run build
8177

.gitignore

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,11 @@ npm-debug.log
77
.jshintrc
88
.vs/
99

10-
# The command'npm install --prefix test' adds files in the test folder (https://docs.npmjs.com/configuring-npm/folders.html#executables).
11-
# There are 2 kinds of files, those without extension and those with cmd extension.
12-
# To ignore files without a extension, following procedure is nessecary:
13-
# - ignore all files in the test folder
14-
# - unignore all files in subdirectories of the test folder
15-
# - unignore all files with an extension in the test folder
16-
test/*
17-
!test/*/
18-
!test/*.*
19-
test/*.cmd
2010
test/unit/build
2111
test/treeshake/index.bundle.js
2212
test/treeshake/index.bundle.min.js
2313
test/treeshake/index-src.bundle.min.js
2414
test/treeshake/stats.html
25-
15+
test/e2e/chromium
2616

2717
**/node_modules

0 commit comments

Comments
 (0)