Skip to content

Commit

Permalink
Rename codegen_test to test_codegen and integration to `test_in…
Browse files Browse the repository at this point in the history
…tegration` for better visibility.
  • Loading branch information
LouisGariepy committed Nov 24, 2022
1 parent 4d55809 commit 235ec40
Show file tree
Hide file tree
Showing 26 changed files with 166 additions and 79 deletions.
219 changes: 150 additions & 69 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[workspace]
members = ["examples/*", "integration", "codegen_test", "benches", "crates/*"]
members = [
"examples/*",
"test_integration",
"test_codegen",
"benches",
"crates/*",
]
6 changes: 3 additions & 3 deletions benches/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ fn bench(c: &mut Criterion) {
cornucopia::container::setup(false).unwrap();
let client = &mut cornucopia_conn().unwrap();

cornucopia::load_schema(client, vec!["../codegen_test/schema.sql".into()]).unwrap();
cornucopia::load_schema(client, vec!["../test_codegen/schema.sql".into()]).unwrap();
c.bench_function("codegen_sync", |b| {
b.iter(|| {
cornucopia::generate_live(
client,
"../codegen_test/queries",
"../test_codegen/queries",
None,
CodegenSettings {
is_async: false,
Expand All @@ -25,7 +25,7 @@ fn bench(c: &mut Criterion) {
b.iter(|| {
cornucopia::generate_live(
client,
"../codegen_test/queries",
"../test_codegen/queries",
None,
CodegenSettings {
is_async: true,
Expand Down
2 changes: 1 addition & 1 deletion codegen_test/Cargo.toml → test_codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "codegen_test"
name = "test_codegen"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion integration/Cargo.toml → test_integration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "integration"
name = "test_integration"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion integration/README.md → test_integration/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Integration testing entrypoint.

This acts like a testing harness. It manages the database required for testing, coordinates the execution of tests and reports the results of the test suite. Internally, it uses many of our workspace crates, notably `codegen_test`, but also `examples` and `benches`.
This acts like a testing harness. It manages the database required for testing, coordinates the execution of tests and reports the results of the test suite. Internally, it uses many of our workspace crates, notably `test_codegen`, but also `examples` and `benches`.

Our integration testing not only checks that Cornucopia is able to generate the code, but it also tests that the right error messages are reported in case of user errors. It also runs the generated code to ensure its correctness.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[[codegen]]
name = "Sync"
base_path = "codegen_test"
base_path = "test_codegen"
destination = "src/cornucopia_sync.rs"
derive_ser = true
sync = true
run = "codegen_test"
run = "test_codegen"

[[codegen]]
name = "Async"
base_path = "codegen_test"
base_path = "test_codegen"
destination = "src/cornucopia_async.rs"
derive_ser = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 235ec40

Please sign in to comment.