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-42798: Add a test for missing metadata table #43

Merged
merged 1 commit into from Feb 28, 2024
Merged

Conversation

andy-slac
Copy link
Collaborator

The issue on this ticket has been fixed already (accidentally) on DM-42489, but there was no unit test for this problem. Extended one of the unit tests to cover it.

# database is missing it.
apdb = make_apdb(config)
metadata = apdb.metadata
self.assertTrue(metadata.empty())
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I don't understand this test. How does it create a scenario where the DB is missing the metadata table? I assume that, with the above rename, config is still the baseline config...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

config here is indeed a baseline config which has metadata table, but the database schema is created above with config_nometa which is missing metadata table (it is dropped from configuration by update_schema_yaml()).

Copy link
Member

Choose a reason for hiding this comment

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

Ah, got it. Then please add a comment noting that the APDB was initialized previously. It's a bit too easy to miss that the steps aren't independent.

# database is missing it.
apdb = make_apdb(config)
metadata = apdb.metadata
self.assertTrue(metadata.empty())
Copy link
Member

Choose a reason for hiding this comment

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

Ah, got it. Then please add a comment noting that the APDB was initialized previously. It's a bit too easy to miss that the steps aren't independent.

The issue on this ticket has been fixed already (accidentally) on
DM-42489, but there was no unit test for this problem. Extended one
of the unit tests to cover it.
@andy-slac andy-slac merged commit cc2b57d into main Feb 28, 2024
6 checks passed
@andy-slac andy-slac deleted the tickets/DM-42798 branch February 28, 2024 00: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
2 participants