Use a single npm target to run unit tests (#1430)

* Combine test steps into one npm script.

* Update README

* Return the test run exit status as the overall exit status
This commit is contained in:
Jason Robbins 2021-07-21 15:36:48 -07:00 коммит произвёл GitHub
Родитель 849a8536fa
Коммит b275a625ae
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -54,12 +54,10 @@ npm run lint
To run unit tests:
```bash
npm run start-emulator # Start the emulator
npm run test # Reset the datastore emulator and start testing
npm run stop-emulator # Stop the emulator. You do not have to stop the emulator between consecutive tests
npm test
```
Note: featurelist is temporarily excluded because lit-analyzer throws `Maximum call stack size exceeded`.
This will start a local datastore emulator, run unit tests, and then shut down the emulator.
There are some developing information in developer-documentation.md.
@ -70,7 +68,6 @@ There are some developing information in developer-documentation.md.
- When installing the GAE SDK, make sure to get the version for python 2.7. It is no longer the default version.
- When running `npm start` you may get an ImportError for jinja2.tests. This was caused by an over-general line in skip_files.yaml. Pulling the latest source code should resolve the problem.
#### Blink components

Просмотреть файл

@ -10,9 +10,10 @@
"deps": "python -m pip install -t lib -r requirements.txt --upgrade",
"travis-deps": "pip install -t lib -r requirements.travis.txt --upgrade",
"dev-deps": "python -m pip install --no-deps -r requirements.dev.txt",
"test": "curl -X POST 'http://localhost:15606/reset' && python -m unittest discover -p '*_test.py' -b",
"do-tests": "curl -X POST 'http://localhost:15606/reset' && python -m unittest discover -p '*_test.py' -b",
"start-emulator" : "gcloud beta emulators datastore start --host-port=:15606 --no-store-on-disk --consistency=1.0",
"stop-emulator" : "curl -X POST 'http://localhost:15606/shutdown'",
"test": "(npm run start-emulator > /dev/null 2>&1 &); sleep 3; curl --retry 4 http://localhost:15606/ --retry-connrefused; npm run do-tests; status=$?; npm run stop-emulator; exit $status",
"coverage": "python -m pip install --no-deps -r requirements.dev.txt && python -m coverage erase && python -m coverage run -m unittest discover -p '*_test.py' -b && python -m coverage html",
"lint": "gulp lint-fix && lit-analyzer \"static/elements/chromedash-!(featurelist)*.js\"",
"build": "gulp",