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/DB Refresh: refresh & database integrity #484

Open
Tracked by #353
joeflack4 opened this issue Jul 13, 2023 · 1 comment · May be fixed by #501
Open
Tracked by #353

Test/DB Refresh: refresh & database integrity #484

joeflack4 opened this issue Jul 13, 2023 · 1 comment · May be fixed by #501
Assignees

Comments

@joeflack4
Copy link
Member

joeflack4 commented Jul 13, 2023

Overview

We need to test the refresh. And we probably need a good set of unit tests to run on the database to check integrity. They can be ran after the refresh from datasets, refresh from objects, regularly, or ad hoc.

Will need to think through this, but basically we should run a set of tests on every table/view.

Two approaches

Testing with existing data

  1. Make concept set TermHub Test Static -- just one version
  2. Make sure it's not already in the database (make the test agnostic to using live or test databases)
  3. Update modified_at for container and version (by updating a field like notes or limitations using actions update api)
  4. Set archived = false
  5. Launch db-refresh
  6. Wait a little
  7. Check for presence of expected data
    a. concept_set_container, code_sets, concept_set_members, concept_set version_item
    b. also derived table all_csets, cset_members_items, ... (not sure what else)
  8. Check front end for presence of this concept set
  9. Delete data from database
    a. concept set container, codesets, conceptset version item, concept set members
    a. rerun ddl tables (done in refresh.py)
  10. Update archived = true on the container

Testing with new data

  1. Have one concept set that we keep adding new versions to: TermHub Test New Version
  2. Upload new version, include datetime in some metadata field
  3. Update archived = false on the container
  4. Launch db-refresh
  5. Wait a little
  6. Check for presence of expected data
    a. concept_set_container, code_sets, concept_set version_item -- NOT concept_set_members, which won't be ready for a while
    b. keep checking until concept_set_members records for new codeset_id show up
    c. also check derived table all_csets, cset_members_items, ... (not sure what else)
  7. Check front end for presence of this concept set
  8. Delete data from database
  9. Update archived = true on the container

Solving this will solve :

Specific things to test

  • Make sure derived tables have new data
This was referenced Jul 13, 2023
@joeflack4 joeflack4 moved this to Todo in TermHub Jul 13, 2023
@joeflack4 joeflack4 changed the title Unit tests: database integrity Unit tests: refresh & database integrity Jul 19, 2023
@joeflack4
Copy link
Member Author

joeflack4 commented Jul 22, 2023

@siggie: I'm not sure how this is related to:

@hugwuoke hugwuoke linked a pull request Aug 4, 2023 that will close this issue
@hugwuoke hugwuoke linked a pull request Aug 4, 2023 that will close this issue
@Sigfried Sigfried added this to the Functioning DB refresh milestone Aug 11, 2023
@Sigfried Sigfried removed this from the Functioning DB refresh milestone Aug 23, 2023
@joeflack4 joeflack4 moved this from Todo to Soon in TermHub Sep 18, 2023
@joeflack4 joeflack4 added this to the DB refresh: core components milestone Nov 1, 2023
@joeflack4 joeflack4 changed the title Unit tests: refresh & database integrity Testing/DB Refresh: refresh & database integrity Nov 1, 2023
@joeflack4 joeflack4 assigned joeflack4 and unassigned hugwuoke Apr 13, 2024
@joeflack4 joeflack4 moved this from Soon to Backlog in TermHub Apr 13, 2024
@joeflack4 joeflack4 changed the title Testing/DB Refresh: refresh & database integrity Test/DB Refresh: refresh & database integrity May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 3. Backlog
Development

Successfully merging a pull request may close this issue.

3 participants