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

DM-44158: Add database tests #243

Merged
merged 13 commits into from
Aug 16, 2024
Merged

DM-44158: Add database tests #243

merged 13 commits into from
Aug 16, 2024

Conversation

JeremyMcCormick
Copy link
Collaborator

@JeremyMcCormick JeremyMcCormick commented Aug 5, 2024

This adds GitHub workflows and actions for testing whether database functionality works correctly for each schema file in the yml directory. There are three separate workflows for tests using MySQL, PostgreSQL, and SQLite. These are all called via workflow_dispatch by the test.yaml workflow.

Tested functionality on each schema includes:

  • Creating a database using the felis create command
  • Generating SQL files using the felis create command with --output-file
  • Loading the generated SQL files from the command line using the database command line client.
  • Initializing and populating the TAP_SCHEMA database

The checks do not all pass now, because there are errors in some of these steps, mainly for MySQL.

Also, TAP_SCHEMA loading does not work for any of the database types, because there are currently duplicate FK constraint names in the ConsDB schemas. (This is a known issue and will be fixed soon.)

@JeremyMcCormick JeremyMcCormick marked this pull request as draft August 5, 2024 19:10
@JeremyMcCormick JeremyMcCormick force-pushed the tickets/DM-44158 branch 29 times, most recently from 0e62f1b to dc355de Compare August 7, 2024 22:01
@JeremyMcCormick JeremyMcCormick force-pushed the tickets/DM-44158 branch 8 times, most recently from 73e44fa to d8c2682 Compare August 12, 2024 21:33
@JeremyMcCormick JeremyMcCormick force-pushed the tickets/DM-44158 branch 2 times, most recently from 68fb6f0 to 0cd2791 Compare August 12, 2024 21:56
Insert a dummy mysql:datatype so that the schema can be instantiated
into MySQL during CI.
The maximum length of a char column in MySQL is 255, so the string type
needs to be used here instead.
Copy link
Collaborator

@gpdf gpdf left a comment

Choose a reason for hiding this comment

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

This is a big step forward in testability; looks good to me.

@@ -7749,7 +7749,7 @@ tables:
tap:std: 1
tap:principal: 1
ivoa:unit:
datatype: char
datatype: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Confirmed with @iagaponenko that this is the right type, matching what's actually deployed in Qserv, VARCHAR(512)

@JeremyMcCormick JeremyMcCormick merged commit 3cbef8c into main Aug 16, 2024
9 checks passed
@JeremyMcCormick JeremyMcCormick deleted the tickets/DM-44158 branch August 16, 2024 18:51
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.

2 participants