diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 593027bdc8..93ad225b39 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,9 +10,9 @@ Before your create a PR, please check to see if there is [an existing issue](htt Not adhering to this guideline will result in the PR being closed. -## Tests +## Testing and Formatting Your Code -1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up [your Gradio environment locally](https://github.com/gradio-app/gradio/blob/main/CONTRIBUTING.md) and run the tests: `bash scripts/run_all_tests.sh` +1. PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up [your Gradio environment locally](https://github.com/gradio-app/gradio/blob/main/CONTRIBUTING.md) and run the backed tests: `bash scripts/run_backend_tests.sh` -2. You may need to run the linters: `bash scripts/format_backend.sh` and `bash scripts/format_frontend.sh` +2. Please run these bash scripts to automatically format your code: `bash scripts/format_backend.sh`, and (if you made any changes to non-Python files) `bash scripts/format_frontend.sh` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bea944895f..5c97432c23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,7 +143,7 @@ We use Pytest, Playwright and Vitest to test our code. - The Python tests are located in `/test`. To run these tests: ``` -bash scripts/run_all_tests.sh +bash scripts/run_backend_tests.sh ``` - The frontend unit tests are any defined with the filename `*.test.ts`. To run them: diff --git a/scripts/run_all_tests.sh b/scripts/run_all_tests.sh deleted file mode 100755 index 4bb432031c..0000000000 --- a/scripts/run_all_tests.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -eu - -cd "$(dirname ${0})/.." - -echo "Running the tests..." -python -m pytest --cov=gradio --durations=20 --durations-min=1 test diff --git a/scripts/run_backend_tests.sh b/scripts/run_backend_tests.sh new file mode 100755 index 0000000000..07b2dc7081 --- /dev/null +++ b/scripts/run_backend_tests.sh @@ -0,0 +1,6 @@ +#!/bin/bash -eu + +cd "$(dirname ${0})/.." + +echo "Running the backend unit tests..." +python -m pytest test -m "not flaky"