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

Spin-up CKAN for testing in Github Actions #192

Merged
merged 8 commits into from
Jan 27, 2023
Merged

Conversation

fjuniorr
Copy link
Contributor

Description

Closes #144

Docker is not supported fully on Windows and MacOS runners, therefore the tests against CKAN are run only for ubuntu. Because of this I'm also generating code coverage and running r-devel against ubuntu.

The tricky part for me was discovering that by default docker compose sets up a single network. Each container joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name. However, the hostname of the docker container cannot be seen from the host unless /etc/hosts is updated.

@fjuniorr
Copy link
Contributor Author

Because I'm running all tests against http://localhost:5000 after d6931 and there is no CKAN for windows and macosx, the tests are failing.

Some options would be:

  • Skip tests on windows and macos (bad because locally they could still work)
  • Drop CI tests on windows and macos (bad because it's likely a big user base)

Not sure how to approach this. Any ideas @maelle?

@maelle
Copy link
Member

maelle commented Jan 2, 2023

Skip tests on windows and macos (bad because locally they could still work)

Would writing a custom skipper help? https://testthat.r-lib.org/articles/skipping.html
It'd be a combination of the internal code of testthat:::on_ci() and the code for recognizing which OS is meant.

  • If not on CI, run the test.
  • If on CI, run only if OS where it is possible.

@fjuniorr
Copy link
Contributor Author

I've reused ckanr::check_ckan for this, which skips a test if CKAN is offline. A name like skip_if_ckan_offline would probably be easier to understand, but I will leave this change for latter after I've grokked the rationale behind the PRs

The failing tests for CKAN 2.9 are being tracked at #189.

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.

CKAN for testing
2 participants