Skip to content

Commit

Permalink
feat(ci): enable integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
zcabter committed Sep 12, 2024
1 parent 1475a6a commit 9528349
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"crates/jstz_rollup",
"crates/jstz_sdk",
"crates/jstz_wpt",
"crates/jstzd",
"crates/octez"
]

Expand Down
10 changes: 10 additions & 0 deletions crates/jstzd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "jstzd"
authors.workspace = true
version.workspace = true
edition.workspace = true
repository.workspace = true

[[bin]]
name = "jstzd"
path = "src/main.rs"
3 changes: 3 additions & 0 deletions crates/jstzd/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
11 changes: 11 additions & 0 deletions crates/jstzd/tests/jstzd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#[test]
fn test_capture_hello_world() {
let output = std::process::Command::new("cargo")
.args(["run", "--bin", "jstzd"])
.arg("jstzd")
.output()
.expect("Failed to run cargo run");
let stdout =
String::from_utf8(output.stdout).expect("Failed to convert stdout to string");
assert!(stdout.contains("Hello, world!"));
}
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
nixConfig = {
extra-trusted-public-keys = "trilitech-jstz.cachix.org-1:+ShRijHoxI9xAIZRP6Mov3aFui5FvgMHJ2M360OEYTo=";
extra-substituters = "https://trilitech-jstz.cachix.org";
};
# nixConfig = {
# extra-trusted-public-keys = "trilitech-jstz.cachix.org-1:+ShRijHoxI9xAIZRP6Mov3aFui5FvgMHJ2M360OEYTo=";
# extra-substituters = "https://trilitech-jstz.cachix.org";
# };

inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
Expand Down
6 changes: 6 additions & 0 deletions nix/crates.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ in {
jstz_rollup = crate "jstz_rollup";
inherit jstz_kernel;
jstz_wpt = crate "jstz_wpt";
jstzd = crate "jstzd";
octez = crate "octez";

# Special target to build all crates in the workspace
Expand Down Expand Up @@ -134,5 +135,10 @@ in {

# TODO(https://linear.app/tezos/issue/JSTZ-44)
# Run the integration tests
cargo-test-integration = craneLib.cargoNextest (commonWorkspace
// {
cargoArtifacts = cargoDeps;
cargoNextestExtraArg = "--test jstzd";
});
};
}

0 comments on commit 9528349

Please sign in to comment.