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

GitHub Actions for CI tests #113

Open
4 of 11 tasks
anthonyfok opened this issue Jun 7, 2021 · 0 comments
Open
4 of 11 tasks

GitHub Actions for CI tests #113

anthonyfok opened this issue Jun 7, 2021 · 0 comments

Comments

@anthonyfok
Copy link
Member

anthonyfok commented Jun 7, 2021

Add some CI tests with GitHub Actions to try to catch potential issues automatically.

Sprint 36

  • Get add_data.sh to run in GitHub-hosted ubuntu-20.04 runner with postgis/postgis as a service
    • Read sample.env, but override POSTGRES_HOST from db-opendrr to localhost
    • Populate python/config.ini with our GitHub personal access token
    • Install python3-{pandas,numpy,elasticsearch}
    • Install Jenkspy? (not available as .deb)
  • Get docker-compose up --build to run
  • Get docker compose up --build to run

Sprint 37

  • Ensure each database is populated. (Bug in Pipeline optimization (Sprint 34–36) #105 as of 2021-06-10)
  • Ensure each CSV header is legit. (Bug in Pipeline optimization (Sprint 34–36) #105 as of 2021-06-10, merge_csv: "RUN: awk" log seeping into the CSV file...)
  • Ensure file name or directory name with spaces are properly handled by fetch_csv_xz and fetch_csv_lfs, e.g. exposure/general-building-stock/1. documentation/collapse_probability.csv
  • TODO (I'm sure I had something else to add, but forgot.)

Test cases include (but not limited to):

  • add_data.sh: "dry run", "download-only run" etc. should be successful
  • add_data.sh: Unit tests
  • Data integrity tests, e.g. some simple tests to ensure a table is correctly populated, not missing columns like lat and lon
  • Try to catch warnings and non-fatal errors from the output of docker compose logs

Ideas and TODOs:

  • Try both running docker compose and without (ubuntu runner + postgis service).
  • Add GitHub badges on README.md to show if all tests pass or not.

Thoughts:

Unit testing tool for bash: BATS vs ShellSpec

@anthonyfok anthonyfok added this to the Sprint 36 milestone Jun 7, 2021
@anthonyfok anthonyfok self-assigned this Jun 7, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Jun 17, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Jun 17, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Jun 17, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Jun 17, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 36, Sprint 37 Jun 17, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 37, Sprint 38, Sprint 39 Jul 13, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 39, Sprint 40 Aug 5, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 40, Sprint 41, Sprint 42 Sep 9, 2021
@jvanulde jvanulde modified the milestones: Sprint 42, Sprint 43 Sep 23, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 43, Sprint 44 Oct 13, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 44, Sprint 45 Oct 25, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 45, Sprint 46 Nov 8, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 46, Sprint 47 Nov 22, 2021
anthonyfok added a commit that referenced this issue Nov 25, 2021
@anthonyfok anthonyfok removed this from the Sprint 47 milestone Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants