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

Add CI/CD and pre-commit #11

Merged
merged 19 commits into from
Feb 10, 2022
Merged

Add CI/CD and pre-commit #11

merged 19 commits into from
Feb 10, 2022

Conversation

CasperWA
Copy link
Contributor

@CasperWA CasperWA commented Feb 4, 2022

Closes #5
Closes #9

GitHub Actions CI/CD workflows are added to run pytest, pre-commit, pylint, and test building the package.
Also for publishing the package upon creating a GitHub release.

Add pytest dependencies and configuration.

Add pre-commit with similar hooks as for oteapi-core.
Update the codebase to comply with the pre-commit hooks (black, mypy, bandit, pylint, isort, and assorted pre-commit-hooks).

@CasperWA CasperWA force-pushed the cwa/close-5-9-tests-dev-tools-ci branch from 5f0d0f0 to e026f34 Compare February 8, 2022 09:01
@CasperWA CasperWA marked this pull request as ready for review February 8, 2022 09:01
@CasperWA CasperWA marked this pull request as draft February 8, 2022 09:01
A central fixture will mock OTE server responses.
It was truly testing the `OntoTransServer`, and not `dataresource`.
Move fixture with test data to the test file.
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@92be565). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #11   +/-   ##
=========================================
  Coverage          ?   73.54%           
=========================================
  Files             ?       10           
  Lines             ?      155           
  Branches          ?        0           
=========================================
  Hits              ?      114           
  Misses            ?       41           
  Partials          ?        0           
Flag Coverage Δ
linux 73.54% <0.00%> (?)
windows 73.54% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92be565...fd58c40. Read the comment docs.

Test if response is "OK" for every use of `requests` and raise
`ApiError` if not "OK", i.e., if the response code is not in the 200s.

Properly set the `status` variable for `ApiError`.
Avoid cloning in the complete oteapi-services repository and instead
have a local docker-compose file to use for the CI test with a real
backend.

Set the same environment variable prefix for the otelib settings as is
set for oteapi-services (`OTEAPI_`).
@CasperWA CasperWA mentioned this pull request Feb 8, 2022
@CasperWA
Copy link
Contributor Author

CasperWA commented Feb 8, 2022

The failing test will succeed as soon as EMMC-ASBL/oteapi-services#42 and EMMC-ASBL/oteapi-services#43 have been merged.

42 fixes the actual issue and 43 will make sure to update the container (Docker) image upon every new push to master in oteapi-services.

@CasperWA CasperWA marked this pull request as ready for review February 8, 2022 16:55
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jesper-friis jesper-friis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OntoTransServer has been renamed to OTEClient

@CasperWA
Copy link
Contributor Author

CasperWA commented Feb 9, 2022

OntoTransServer has been renamed to OTEClient

Not yet - #8 has not yet been merged. It will be merged now, however, and this will be updated accordingly. Good catch though :)

@CasperWA CasperWA merged commit 05d514b into master Feb 10, 2022
@CasperWA CasperWA deleted the cwa/close-5-9-tests-dev-tools-ci branch February 10, 2022 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup development tools and CI Set up testing framework
3 participants