Skip to content

Commit

Permalink
build the go app.
Browse files Browse the repository at this point in the history
  • Loading branch information
t4lz committed Oct 9, 2022
1 parent 6bdf6cb commit e8be805
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ jobs:
with:
key: ubuntu-latest
cache-on-failure: true
- uses: actions/setup-go@v3
with:
go-version: "1.18.0"
- run: |
cd mirrord-layer/tests/apps/app_go
go build -o 18
- uses: actions/setup-go@v3
with:
go-version: "1.19.0"
Expand Down
24 changes: 23 additions & 1 deletion mirrord-layer/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
use std::{collections::HashMap, path::PathBuf, process::Stdio, time::Duration};
use std::{
collections::HashMap,
env,
path::{Path, PathBuf},
process,
process::Stdio,
time::Duration,
};

use actix_codec::Framed;
use futures::{stream::StreamExt, SinkExt};
Expand Down Expand Up @@ -182,6 +189,21 @@ impl Application {
}
}

/// For running locally, so that new developers don't have the extra step of building the go app
/// before running the tests.
#[cfg(test)]
#[ctor::ctor]
fn build_go_app() {
let original_dir = env::current_dir().unwrap();
let go_app_path = Path::new("tests/apps/app_go");
env::set_current_dir(go_app_path).unwrap();
let server = process::Command::new("go")
.args(vec!["build", "-o", "19"])
.output()
.expect("Failed to build Go test app.");
env::set_current_dir(original_dir).unwrap();
}

/// Return the path to the existing layer lib, or build it first and return the path, according to
/// whether the environment variable MIRRORD_TEST_USE_EXISTING_LIB is set.
/// When testing locally the lib should be rebuilt on each run so that when developers make changes
Expand Down

0 comments on commit e8be805

Please sign in to comment.