mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
Merge pull request #299 from gristlabs/python-tests-ci
Run python tests during main workflow
This commit is contained in:
commit
963bf420f4
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
@ -44,6 +44,9 @@ jobs:
|
||||
- name: Run smoke test
|
||||
run: VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:smoke
|
||||
|
||||
- name: Run python tests
|
||||
run: yarn run test:python
|
||||
|
||||
- name: Run main tests
|
||||
run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test
|
||||
|
||||
|
40
README.md
40
README.md
@ -291,12 +291,42 @@ Testing:
|
||||
|
||||
Variable | Purpose
|
||||
-------- | -------
|
||||
GRIST_TESTING_SOCKET | a socket used for out-of-channel communication during tests only.
|
||||
GRIST_TESTING_SOCKET | a socket used for out-of-channel communication during tests only.
|
||||
GRIST_TEST_HTTPS_OFFSET | if set, adds https ports at the specified offset. This is useful in testing.
|
||||
GRIST_TEST_SSL_CERT | if set, contains filename of SSL certificate.
|
||||
GRIST_TEST_SSL_KEY | if set, contains filename of SSL private key.
|
||||
GRIST_TEST_LOGIN | allow fake unauthenticated test logins (suitable for dev environment only).
|
||||
GRIST_TEST_ROUTER | if set, then the home server will serve a mock version of router api at /test/router
|
||||
GRIST_TEST_SSL_CERT | if set, contains filename of SSL certificate.
|
||||
GRIST_TEST_SSL_KEY | if set, contains filename of SSL private key.
|
||||
GRIST_TEST_LOGIN | allow fake unauthenticated test logins (suitable for dev environment only).
|
||||
GRIST_TEST_ROUTER | if set, then the home server will serve a mock version of router api at /test/router
|
||||
GREP_TESTS | pattern for selecting specific tests to run (e.g. `env GREP_TESTS=ActionLog yarn test`).
|
||||
|
||||
## Tests
|
||||
|
||||
Tests are run automatically as part of CI when a PR is opened. However, it can be helpful to run tests locally
|
||||
before pushing your changes to GitHub. First, you'll want to make sure you've installed all dependencies:
|
||||
|
||||
```
|
||||
yarn install
|
||||
yarn install:python
|
||||
```
|
||||
|
||||
Then, you can run the main test suite like so:
|
||||
|
||||
```
|
||||
yarn test
|
||||
```
|
||||
|
||||
Python tests may also be run locally. (Note: currently requires Python 3.9.)
|
||||
|
||||
```
|
||||
yarn test:python
|
||||
```
|
||||
|
||||
For running specific tests, you can specify a pattern with the `GREP_TESTS` variable:
|
||||
|
||||
```
|
||||
env GREP_TESTS=ChoiceList yarn test
|
||||
env GREP_TESTS=summary yarn test:python
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
"test:server": "GRIST_SESSION_COOKIE=grist_test_cookie NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/server/**/*.js _build/test/gen-server/**/*.js",
|
||||
"test:smoke": "NODE_PATH=_build:_build/stubs:_build/ext mocha _build/test/nbrowser/Smoke.js",
|
||||
"test:docker": "./test/test_under_docker.sh",
|
||||
"test:python": "sandbox_venv3/bin/python sandbox/grist/runtests.py ${GREP_TESTS:+discover -p \"test*${GREP_TESTS}*.py\"}",
|
||||
"cli": "NODE_PATH=_build:_build/stubs:_build/ext node _build/app/server/companion.js"
|
||||
},
|
||||
"keywords": [
|
||||
|
Loading…
Reference in New Issue
Block a user