-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update primer
tests to own file, separate batches and concurrent runs
#5425
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -475,71 +475,3 @@ jobs: | |
run: | | ||
. venv/bin/activate | ||
pytest --benchmark-disable tests/ | ||
|
||
pytest-primer-stdlib: | ||
name: Run primer tests on stdlib Python ${{ matrix.python-version }} (Linux) | ||
runs-on: ubuntu-latest | ||
needs: prepare-tests-linux | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.prepare-tests-linux.outputs.python-key }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
echo "Failed to restore Python venv from cache" | ||
exit 1 | ||
- name: Run pytest | ||
run: | | ||
. venv/bin/activate | ||
pip install -e . | ||
pytest -m primer_stdlib --primer-stdlib -n auto | ||
|
||
pytest-primer-external: | ||
name: Run primer tests on external libs Python ${{ matrix.python-version }} (Linux) | ||
runs-on: ubuntu-latest | ||
needs: prepare-tests-linux | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.prepare-tests-linux.outputs.python-key }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
echo "Failed to restore Python venv from cache" | ||
exit 1 | ||
- name: Run pytest | ||
run: | | ||
. venv/bin/activate | ||
pip install -e . | ||
pytest -m primer_external --primer-external -n auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
name: Primer tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 2.* | ||
pull_request: | ||
paths: | ||
- "pylint/**" | ||
- "tests/primer/**" | ||
|
||
env: | ||
CACHE_VERSION: 3 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare-tests-linux: | ||
name: Prepare tests for Python ${{ matrix.python-version }} (Linux) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
outputs: | ||
python-key: ${{ steps.generate-python-key.outputs.key }} | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Generate partial Python venv restore key | ||
id: generate-python-key | ||
run: >- | ||
echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{ | ||
hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt') | ||
}}" | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: >- | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
steps.generate-python-key.outputs.key }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}- | ||
- name: Create Python virtual environment | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
python -m venv venv | ||
. venv/bin/activate | ||
python -m pip install -U pip setuptools wheel | ||
pip install -U -r requirements_test.txt | ||
|
||
pytest-primer-stdlib: | ||
name: Run primer tests on stdlib Python ${{ matrix.python-version }} (Linux) | ||
runs-on: ubuntu-latest | ||
needs: prepare-tests-linux | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.prepare-tests-linux.outputs.python-key }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
echo "Failed to restore Python venv from cache" | ||
exit 1 | ||
- name: Run pytest | ||
run: | | ||
. venv/bin/activate | ||
pip install -e . | ||
pytest -m primer_stdlib --primer-stdlib -n auto | ||
|
||
pytest-primer-external-batch-one: | ||
name: | ||
Run primer tests batch one on external libs Python ${{ matrix.python-version }} | ||
(Linux) | ||
runs-on: ubuntu-latest | ||
needs: prepare-tests-linux | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.prepare-tests-linux.outputs.python-key }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
echo "Failed to restore Python venv from cache" | ||
exit 1 | ||
- name: Run pytest | ||
run: | | ||
. venv/bin/activate | ||
pip install -e . | ||
pytest -m primer_external_batch_one --primer-external -n auto | ||
|
||
pytest-primer-external-batch-two: | ||
name: | ||
Run primer tests batch two on external libs Python ${{ matrix.python-version }} | ||
(Linux) | ||
runs-on: ubuntu-latest | ||
needs: prepare-tests-linux | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.prepare-tests-linux.outputs.python-key }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
echo "Failed to restore Python venv from cache" | ||
exit 1 | ||
- name: Run pytest | ||
run: | | ||
. venv/bin/activate | ||
pip install -e . | ||
pytest -m primer_external_batch_two --primer-external -n auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"black": { | ||
"branch": "main", | ||
"directories": ["src/black/", "src/blackd/", "src/black_primer/", "src/blib2to3/"], | ||
"url": "https://github.com/psf/black.git" | ||
}, | ||
"django": { | ||
"branch": "main", | ||
"directories": ["django"], | ||
"url": "https://github.com/django/django.git" | ||
}, | ||
"flask": { | ||
"branch": "main", | ||
"directories": ["src/flask"], | ||
"url": "https://github.com/pallets/flask.git" | ||
}, | ||
"graph-explorer": { | ||
"branch": "master", | ||
"directories": ["graph_explorer"], | ||
"pylintrc_relpath": ".pylintrc", | ||
"url": "https://github.com/vimeo/graph-explorer.git" | ||
}, | ||
"home-assistant": { | ||
"branch": "dev", | ||
"directories": ["homeassistant"], | ||
"url": "https://github.com/home-assistant/core.git" | ||
}, | ||
"keras": { | ||
"branch": "master", | ||
"directories": ["keras"], | ||
"url": "https://github.com/keras-team/keras.git" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to find a way to not copy paste so much, did you also search and find nothing acceptable or did you simply implement something fast ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simply implemented something fast. Do you want me to look if something is possible before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, let's keep the MR small and do it later on. Also this CI speed up is too valuable to wait, clearly 😄