Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puppeteer E2E test: Auto-download browser #25380

Merged
merged 5 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contribution
## Introduction

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/)
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/)

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

npm start

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.
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.

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

Run this command from the root folder to install test dependencies.

npm install --prefix test

And run tests.

npm test
- `npm run test` - Lint testing and unit testing (individually being `npm run lint` and `npm run test-unit`)
- `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

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.

Many linting errors can be fixed automatically by running
Most linting errors can be fixed automatically by running

npm lint-fix
npm run lint-fix

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

npm run build

Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ jobs:
node-version: 16
cache: 'npm'
- name: Install packages
run: |
npm ci
npm ci --prefix test
run: npm ci
- name: Build
run: npm run build

Expand All @@ -73,9 +71,7 @@ jobs:
node-version: 16
cache: 'npm'
- name: Install packages
run: |
npm ci
npm ci --prefix test
run: npm ci
- name: Build
run: npm run build

Expand Down
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@ npm-debug.log
.jshintrc
.vs/

# The command'npm install --prefix test' adds files in the test folder (https://docs.npmjs.com/configuring-npm/folders.html#executables).
# There are 2 kinds of files, those without extension and those with cmd extension.
# To ignore files without a extension, following procedure is nessecary:
# - ignore all files in the test folder
# - unignore all files in subdirectories of the test folder
# - unignore all files with an extension in the test folder
test/*
!test/*/
!test/*.*
test/*.cmd
test/unit/build
test/treeshake/index.bundle.js
test/treeshake/index.bundle.min.js
test/treeshake/index-src.bundle.min.js
test/treeshake/stats.html

test/e2e/chromium

**/node_modules
Loading