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

Run functional tests with datastore_mysql_import enabled #3973

Merged
merged 7 commits into from
Jun 5, 2023

Conversation

paul-m
Copy link
Contributor

@paul-m paul-m commented May 22, 2023

Currently, tests do not run with datastore_mysql_import module enabled, so there are no functional tests which support it.

This PR:

  • Converts (most of) the dkan DatasetTest functional test to a Drupal BrowserTestBase test: DatasetBTBTest
  • Subclasses DatasetBTBTest to MySqlDatasetBTBTest which enables datastore_mysql_import and runs all the same tests.
  • DatasetTest::testResourcePurgeDraft() remains in the old DatasetTest class, because it depends on moderated_content_bulk_publish module, which has an incomplete config schema which fails BTB testing.

Since the new tests now use the real-deal services, and use some more strict validation from BTB, we discover that our tests (and modules) were buggy and needed some attention.

  • Config schema did not validate, so some modules would not enable.
  • Within DatasetBTBTest::getData() we call ValidMetadataFactory::get() which validates the JSON. Our test JSON was not validating. See the @todo in that method.

TODO in follow-ups:

  • Determine how to move DatasetTest::testResourcePurgeDraft() to be a BTB test.
  • Figure out how to get a useful assertion within DatasetBTBTest::getData().

@paul-m paul-m changed the title Fix mysql import datasettest Run functional tests with dataset_mysql_import enabled May 22, 2023
@paul-m paul-m changed the title Run functional tests with dataset_mysql_import enabled Run functional tests with datastore_mysql_import enabled May 22, 2023
@paul-m paul-m marked this pull request as ready for review May 22, 2023 18:00
@janette janette merged commit 5c66d3b into 2.x Jun 5, 2023
@janette janette deleted the fix-mysql-import-datasettest branch June 5, 2023 19:52
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