Skip to content

feat: add a manual trigger for GitHub Action #22

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

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: main
pull_request:
branches: main
workflow_dispatch:

concurrency:
group: check-${{ github.ref }}
Expand Down
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ WIP.

## Make a pull request

The GitHub Actions services will automatically run formatter, linter and test suite (_ci.yml_) after you make a pull request. If you are an outside contributor, a maintainer will review and approve the GitHub checks.
The GitHub Actions services will automatically run formatter, linter and test suite (_ci.yml_) after you make a pull request.

Our test uses an Actions secret called TOKEN. For security reasons, GitHub will not pass Actions secrets to workflows that are triggered by a pull request from a fork.
If you are an outside contributor working on a fork, this means all you checks will fail on the upstream. It will be helpful if you could add an Action secret called TOKEN on your fork, and manually trigger the "Formatting, Linting and Testing" workflow for your feature branch, so we can check the test results on your fork instead of the upstream.

The actual tox environments to run are specified in the [[gh]](https://github.com/tox-dev/tox-gh#basic-example) section of _tox.ini_.

Expand Down Expand Up @@ -167,8 +170,10 @@ $ git rebase origin/main
$ tox
```

3. If you are working on a fork, add an Actions secret called TOKEN, and manually trigger the the "Formatting, Linting and Testing" workflow for your feature branch after pushing your commits.

### After making the pull request

If you find that some GitHub checks failed, you can check the log in the Actions tab to see what went wrong.

Since a successful test run relies on both the backend and the client library, if your local `tox` run passed but GitHub Action checks failed, it's probably because some temporary issues have happened to our backend server. You can have confidence in your commit and rerun the failed jobs.
Since a successful test run relies on both the backend and the client library, if your local `tox` run passed but GitHub Action checks failed, it's probably because some temporary issues have happened to our backend server (especially with 500 server error). You can have confidence in your commit and rerun the failed jobs.
14 changes: 7 additions & 7 deletions tests/robot/suites/02__deployments.robot
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Resource ../resources/general.robot

*** Test Cases ***

01. Get all deployments
${data}= Run method getDeployments without filters
Elements in ${data}[0] have the expected fields for getDeployments
List ${data} has at least 500 rows
# 01. Get all deployments
# ${data}= Run method getDeployments without filters
# Elements in ${data}[0] have the expected fields for getDeployments
# List ${data} has at least 500 rows

02. Filter locationCode
[Tags] runthis
Expand All @@ -23,7 +23,7 @@ Resource ../resources/general.robot
List ${data} has at least 2 rows

03. Filter deviceCategoryCode
${data}= Run method getDeployments with filter deviceCategoryCode="CTD"
${data}= Run method getDeployments with filter deviceCategoryCode="BPR"
Elements in ${data}[0] have the expected fields for getDeployments
List ${data} has at least 50 rows

Expand All @@ -38,9 +38,9 @@ Resource ../resources/general.robot
List ${data} has at least 1 rows

06. ISO Date Range
${data}= Run method getDeployments from "2014-02-24T00:00:01.000Z" to "2014-03-24T00:00:01.000Z"
${data}= Run method getDeployments from "2008-02-24T00:00:01.000Z" to "2008-03-24T00:00:01.000Z"
Elements in ${data}[0] have the expected fields for getDeployments
List ${data} has at least 100 rows
List ${data} has at least 40 rows

08. No deployments found
Run Keyword And Expect Error *404* Run method getDeployments with filters ${F_NO_RESULTS}