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

Test changing test data #41

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0c69a1c
update test data for PRs
bernt-matthias Sep 6, 2021
00b1b8d
try to push
bernt-matthias Sep 7, 2021
eba97e3
Merge pull request #39 from bernt-matthias/topic/update-test-data
bernt-matthias Sep 7, 2021
a6068a0
slash for bernt-matthias
bernt-matthias Sep 8, 2021
e1d9040
missing comma
bernt-matthias Sep 8, 2021
e5c24fe
PR fix on syntax
bernt-matthias Sep 8, 2021
5413b6f
PR fix commit
bernt-matthias Sep 8, 2021
046999e
PR: temp disable for push and PR
bernt-matthias Sep 8, 2021
49b7201
debug
bernt-matthias Sep 8, 2021
6875b6f
debug
bernt-matthias Sep 8, 2021
db0207a
debug
bernt-matthias Sep 8, 2021
fc16bc7
debug
bernt-matthias Sep 8, 2021
6e7b51e
try to get ref
bernt-matthias Sep 8, 2021
bfd65ea
try
bernt-matthias Sep 8, 2021
dcd0c84
try to use ref
bernt-matthias Sep 8, 2021
d7023d6
try
bernt-matthias Sep 8, 2021
a7b51d7
try
bernt-matthias Sep 8, 2021
e1d06f5
checkout the correct ref in all jobs
bernt-matthias Sep 8, 2021
18f76b4
always use branch of the action
bernt-matthias Sep 8, 2021
81bd1e0
try ref instead of sha
bernt-matthias Sep 8, 2021
8e0cf31
only push if changed
bernt-matthias Sep 8, 2021
48db873
checkout from fork for dispactch event
bernt-matthias Sep 8, 2021
531d711
fix
bernt-matthias Sep 8, 2021
2fd0bd8
fix variable name
bernt-matthias Sep 8, 2021
13aaf37
try to commit only if modifying changes are piresent
bernt-matthias Sep 8, 2021
e6df188
typos
bernt-matthias Sep 8, 2021
d613b1e
mod git diff
bernt-matthias Sep 8, 2021
7da2994
revert diff chnage
bernt-matthias Sep 8, 2021
8a70250
fix if
bernt-matthias Sep 8, 2021
0f42038
reenable push and pr
bernt-matthias Sep 8, 2021
34a2248
try to fix empty string
bernt-matthias Sep 8, 2021
8717c96
do not run linters for dispatch actions
bernt-matthias Sep 8, 2021
9789f9d
test changing test data
simonbray Sep 8, 2021
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
115 changes: 101 additions & 14 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Galaxy Tool Linting and Tests for push and PR
on: [push, pull_request]
on:
push:
pull_request:
repository_dispatch:
types: [update-test-data-command]
env:
GALAXY_FORK: galaxyproject
GALAXY_BRANCH: release_21.05
Expand All @@ -21,6 +25,9 @@ jobs:
tool-list: ${{ steps.discover.outputs.tool-list }}
chunk-count: ${{ steps.discover.outputs.chunk-count }}
chunk-list: ${{ steps.discover.outputs.chunk-list }}
update-test-data: ${{ steps.update-test-data.outputs.update-test-data }}
repository: ${{ steps.update-test-data.outputs.repository }}
ref: ${{ steps.update-test-data.outputs.ref }}
strategy:
matrix:
python-version: ['3.7']
Expand All @@ -34,6 +41,33 @@ jobs:
echo 'base_ref: ${{ github.base_ref }}'
echo 'event.before: ${{ github.event.before }}'
echo 'event.after: ${{ github.event.after }}'
- name: Dump the client payload context
env:
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request) }}
run: echo "$PAYLOAD_CONTEXT"
- name: Add reaction to update-test-data slash command
if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }}
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reaction-type: hooray
# for running the update-test-data slash command
# - set update-test-data::true and false otherwise
# - set repository / ref to the PR fork name / latest SHA and '' otherwise (which is the default for the checkout action)
- name: Set variables depending on update-test-data for slash commands
id: update-test-data
run: |
if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then
echo "::set-output name=update-test-data::true"
echo "::set-output name=repository::${{github.event.client_payload.pull_request.head.repo.full_name}}"
echo "::set-output name=ref::${{github.event.client_payload.pull_request.head.ref}}"
else
echo "::set-output name=update-test-data::false"
echo "::set-output name=repository::"
echo "::set-output name=ref::"
fi
- name: Determine latest commit in the Galaxy repo
id: get-galaxy-sha
run: echo "::set-output name=galaxy-head-sha::$(git ls-remote https://github.com/${{ env.GALAXY_FORK }}/galaxy refs/heads/${{ env.GALAXY_BRANCH }} | cut -f1)"
Expand All @@ -60,16 +94,19 @@ jobs:
run: pip install flake8 flake8-import-order
- uses: actions/checkout@v2
with:
repository: ${{ steps.update-test-data.outputs.repository }}
ref: ${{ steps.update-test-data.outputs.ref }}
fetch-depth: 0
- name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
id: discover
with:
create-cache: ${{ steps.cache-pip.outputs.cache-hit != 'true' || steps.cache-planemo.outputs.cache-hit != 'true' }}
galaxy-fork: ${{ env.GALAXY_FORK }}
galaxy-branch: ${{ env.GALAXY_BRANCH }}
max-chunks: ${{ env.MAX_CHUNKS }}
python-version: ${{ matrix.python-version }}
update-test-data: ${{ steps.update-test-data.outputs.update-test-data }}
- name: Show commit range
run: echo '${{ steps.discover.outputs.commit-range }}'
- name: Show repository list
Expand All @@ -84,7 +121,7 @@ jobs:
lint:
name: Lint tool-list
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '' }}
if: ${{ github.event_name != 'repository-dispatch' && (needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -95,6 +132,8 @@ jobs:
# and use it as the current working directory
- uses: actions/checkout@v2
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
fetch-depth: 1
- uses: actions/setup-python@v1
with:
Expand All @@ -106,7 +145,8 @@ jobs:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Planemo lint
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
# uses: galaxyproject/planemo-ci-action@v1
id: lint
with:
mode: lint
Expand All @@ -122,7 +162,7 @@ jobs:
flake8:
name: Lint Python scripts
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' }}
if: ${{ github.event_name != 'repository-dispatch' && needs.setup.outputs.repository-list != '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -131,6 +171,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
fetch-depth: 1
- uses: actions/setup-python@v1
with:
Expand All @@ -154,7 +196,7 @@ jobs:
lintr:
name: Lint R scripts
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' }}
if: ${{ github.event_name != 'repository-dispatch' && needs.setup.outputs.repository-list != '' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -163,6 +205,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
fetch-depth: 1
- uses: r-lib/actions/setup-r@master
with:
Expand Down Expand Up @@ -236,6 +280,8 @@ jobs:
# and use it as the current working directory
- uses: actions/checkout@v2
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
fetch-depth: 1
- uses: actions/setup-python@v1
with:
Expand All @@ -253,7 +299,8 @@ jobs:
path: ~/.planemo
key: planemo_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Planemo test
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
# uses: galaxyproject/planemo-ci-action@v1
id: test
with:
mode: test
Expand All @@ -262,10 +309,44 @@ jobs:
galaxy-branch: ${{ env.GALAXY_BRANCH }}
chunk: ${{ matrix.chunk }}
chunk-count: ${{ needs.setup.outputs.chunk-count }}
update-test-data: ${{ needs.setup.outputs.update-test-data }}
- uses: actions/upload-artifact@v2
with:
name: 'Tool test output ${{ matrix.chunk }}'
path: upload
# push updated test data
# - if no test data was updated then create a note (otherwise the commit should be sufficient)
- name: Push updated test data
if: ${{ needs.setup.outputs.update-test-data }}
id: push-updated-test-data
run: |
set -x
if ! git diff --diff-filter=M --exit-code >& /dev/null; then
git config user.name github-actions
git config user.email [email protected]
git commit -m "update test data" .
git push
echo "::set-output name=number-of-changed-files::$(git diff HEAD^..HEAD --name-only | wc -l)"
else
echo "::set-output name=number-of-changed-files::0"
fi
- name: Create URL to the run output
if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' && steps.push-updated-test-data.outputs.number-of-changed-files != 0 }}
id: vars
run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- name: Create comment
if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' && steps.push-updated-test-data.outputs.number-of-changed-files != 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
body: |
No test data was updated

[Find all tool test results here][1]

[1]: ${{ steps.vars.outputs.run-url }}

# - combine the results of the test chunks (which will never fail due
# to `|| true`) and create a global test report as json and html which
Expand All @@ -275,7 +356,7 @@ jobs:
combine_outputs:
name: Combine chunked test results
needs: [setup, test]
if: ${{ needs.setup.outputs.repository-list != '' }}
if: ${{ github.event_name != 'repository-dispatch' && needs.setup.outputs.repository-list != '' }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -294,7 +375,8 @@ jobs:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Combine outputs
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
# uses: galaxyproject/planemo-ci-action@v1
id: combine
with:
mode: combine
Expand All @@ -304,7 +386,8 @@ jobs:
name: 'All tool test results'
path: upload
- name: Check outputs
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
# uses: galaxyproject/planemo-ci-action@v1
id: check
with:
mode: check
Expand All @@ -313,14 +396,16 @@ jobs:
deploy:
name: Deploy
needs: [setup, lint, flake8, lintr, combine_outputs]
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) && github.repository_owner == 'galaxyproject' }}
if: ${{ github.event_name != 'repository-dispatch' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) && github.repository_owner == 'galaxyproject' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
steps:
- uses: actions/checkout@v2
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
fetch-depth: 1
- uses: actions/setup-python@v1
with:
Expand All @@ -332,15 +417,17 @@ jobs:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Deploy on testtoolshed
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
# uses: galaxyproject/planemo-ci-action@v1
with:
mode: deploy
repository-list: ${{ needs.setup.outputs.repository-list }}
shed-target: testtoolshed
shed-key: ${{ secrets.TTS_API_KEY }}
continue-on-error: true
- name: Deploy on toolshed
uses: galaxyproject/planemo-ci-action@v1
uses: bernt-matthias/planemo-ci-action@topic/update-test-data
# uses: galaxyproject/planemo-ci-action@v1
with:
mode: deploy
repository-list: ${{ needs.setup.outputs.repository-list }}
Expand All @@ -350,7 +437,7 @@ jobs:
determine-success:
name: Check workflow success
needs: [setup, lint, flake8, lintr, combine_outputs]
if: ${{ always() && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
if: ${{ always() && github.event_name != 'repository-dispatch' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Check tool lint status
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/slash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
if: github.repository_owner == 'galaxyproject'
if: github.repository_owner == 'bernt-matthias'
uses: peter-evans/slash-command-dispatch@v2
with:
token: ${{ secrets.PAT }}
commands: |
run-all-tool-tests
config: >
[
{
"command": "run-all-tool-tests",
"issue_type": "issue"
},
{
"command": "update-test-data",
"permission": "write",
"issue_type": "pull-request"
}
]
2 changes: 1 addition & 1 deletion tools/abricate/test-data/output_noresults.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#FILE SEQUENCE START END STRAND GENE COVERAGE COVERAGE_MAP GAPS %COVERAGE %IDENTITY DATABASE ACCESSION PRODUCT RESISTANCE
#FILE SEQUENCE START END STRAND GENE COVERAGE COVERAGE_MAP GAPS %COVERAGE %IDENTITY DATABASE ACCESSION