Skip to content

Generate "crdb-base" directory in target, not temporary directory#563

Merged
smklein merged 5 commits into
mainfrom
crdb-out-dir
Jan 3, 2022
Merged

Generate "crdb-base" directory in target, not temporary directory#563
smklein merged 5 commits into
mainfrom
crdb-out-dir

Conversation

@smklein

@smklein smklein commented Dec 27, 2021

Copy link
Copy Markdown
Collaborator

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

@davepacheco davepacheco left a comment

Copy link
Copy Markdown
Collaborator

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?

2 participants