Skip to content

Conversation

@smklein
Copy link
Collaborator

@smklein smklein commented Dec 27, 2021

image

This new behavior abides by the rules for generating output from a build script, by using the OUT_DIR path available at compile-time.

To ensure that the OUT_DIR path is available to the build script and invocations of test_setup_database, the crates are organized as follows:

  • test-utils, the top-level crate, contains functionality for both populating + copying from a seed directory. This is made available to both the build script (in nexus/test-utils) and any tests (in nexus) that want to call test_setup_database. Calling the test-utils version of test_setup_database now explicitly requires providing a path to the seed directory.
  • The build script within nexus/test-utils defines an OUT_DIR, and creates the crdb-base directory there. It additionally provides another implementation of test_setup_database, which also embeds the path to the crdb-base directory.
  • Most tests use the version of test_setup_database from nexus/test-utils, which embeds the path to crdb-base created from the build script.

Fixes #548

Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@smklein smklein merged commit 747bcc8 into main Jan 3, 2022
@smklein smklein deleted the crdb-out-dir branch January 3, 2022 19:14
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.

seed database used for test suite maybe should live in ./target?

3 participants