Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
chore(integrationtest): directly specify ctl nats port
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Townsend <[email protected]>
  • Loading branch information
brooksmtownsend committed Sep 6, 2023
1 parent 5befc1b commit 3994fd4
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 11 deletions.
33 changes: 28 additions & 5 deletions tests/integration_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ async fn integration_get_hosts_serial() -> Result<()> {
let wash_instance = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args(["get", "hosts", "--output", "json"])
.args([
"get",
"hosts",
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
.await
Expand All @@ -37,10 +44,17 @@ async fn integration_get_hosts_serial() -> Result<()> {
#[tokio::test]
#[serial]
async fn integration_get_links_serial() -> Result<()> {
let _wash_instance = TestWashInstance::create().await?;
let wash_instance = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args(["get", "links", "--output", "json"])
.args([
"get",
"links",
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
.await
Expand All @@ -67,6 +81,8 @@ async fn integration_get_host_inventory_serial() -> Result<()> {
&wash_instance.host_id,
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
Expand Down Expand Up @@ -122,10 +138,17 @@ async fn integration_get_host_inventory_serial() -> Result<()> {
#[tokio::test]
#[serial]
async fn integration_get_claims_serial() -> Result<()> {
let _wash_instance = TestWashInstance::create().await?;
let wash_instance = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args(["get", "claims", "--output", "json"])
.args([
"get",
"claims",
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
.await
Expand Down
11 changes: 9 additions & 2 deletions tests/integration_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ use common::TestWashInstance;
#[tokio::test]
#[serial]
async fn integration_link_serial() -> Result<()> {
let _wash = TestWashInstance::create().await?;
let wash = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args(["link", "query", "--output", "json"])
.args([
"link",
"query",
"--output",
"json",
"--ctl-port",
&wash.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
.await
Expand Down
8 changes: 6 additions & 2 deletions tests/integration_start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use common::{TestWashInstance, ECHO_OCI_REF, PROVIDER_HTTPSERVER_OCI_REF};
#[tokio::test]
#[serial]
async fn integration_start_actor_serial() -> Result<()> {
let _wash_instance = TestWashInstance::create().await?;
let wash_instance = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args([
Expand All @@ -20,6 +20,8 @@ async fn integration_start_actor_serial() -> Result<()> {
"json",
"--timeout-ms",
"40000",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
Expand All @@ -38,7 +40,7 @@ async fn integration_start_actor_serial() -> Result<()> {
#[tokio::test]
#[serial]
async fn integration_start_provider_serial() -> Result<()> {
let _wash_instance = TestWashInstance::create().await?;
let wash_instance = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args([
Expand All @@ -49,6 +51,8 @@ async fn integration_start_provider_serial() -> Result<()> {
"json",
"--timeout-ms",
"40000",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.kill_on_drop(true)
.output()
Expand Down
27 changes: 25 additions & 2 deletions tests/integration_stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ async fn integration_stop_actor_serial() -> Result<()> {
"json",
"--timeout-ms",
"20000",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.output()
.await
Expand All @@ -42,7 +44,16 @@ async fn integration_stop_actor_serial() -> Result<()> {

// Stop the actor
let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args(["stop", "actor", &host_id, &actor_id, "--output", "json"])
.args([
"stop",
"actor",
&host_id,
&actor_id,
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.output()
.await
.context("failed to stop actor")?;
Expand Down Expand Up @@ -70,6 +81,8 @@ async fn integration_stop_provider_serial() -> Result<()> {
"json",
"--timeout-ms",
"20000",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.output()
.await
Expand Down Expand Up @@ -107,6 +120,8 @@ async fn integration_stop_provider_serial() -> Result<()> {
&contract_id,
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.output()
.await
Expand All @@ -127,7 +142,15 @@ async fn integration_stop_host_serial() -> Result<()> {
let wash_instance = TestWashInstance::create().await?;

let output = Command::new(env!("CARGO_BIN_EXE_wash"))
.args(["stop", "host", &wash_instance.host_id, "--output", "json"])
.args([
"stop",
"host",
&wash_instance.host_id,
"--output",
"json",
"--ctl-port",
&wash_instance.nats_port.to_string(),
])
.output()
.await
.context("failed to stop provider")?;
Expand Down

0 comments on commit 3994fd4

Please sign in to comment.