-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hydroflow_plus): add ability to have staged flows inside unit tests
Whenever a Hydroflow+ program is compiled, it depends on a generated `__staged` module, which contains the entire contents of the crate but with every type / function made `pub` and exported, so that the compiled UDFs can resolve local references appropriately. Previously, we would not do this for `#[cfg(test)]` modules, since they may use `dev-dependencies` and therefore the generated module may fail to compile when not in test mode. To solve this, when running a unit test (marked with `hydroflow_plus::deploy::init_test()`) that uses trybuild, we emit a version of the `__staged` module with `#[cfg(test)]` modules included _into the generated trybuild sources_ because we can guarantee via trybuild that the appropriate `dev-dependencies` are available. This by itself allows crates depending on `hydroflow_plus` to have local unit tests with Hydroflow+ logic inside them. But we also want to use this support for unit tests inside `hydroflow_plus` itself. To enable that, we eliminate the `hydroflow_plus_deploy` crate and move its contents directly to `hydroflow_plus` itself so that we can access the trybuild machinery without incurring a circular dependency. Also fixes #1408
- Loading branch information
Showing
69 changed files
with
369 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...droflow_plus_deploy/src/deploy_runtime.rs → hydroflow_plus/src/deploy/deploy_runtime.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.