Skip to content

Commit

Permalink
No longer run e2e tests in Docker
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <[email protected]>
  • Loading branch information
rylev committed Jan 15, 2024
1 parent 0b5f3ff commit 3bab43a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 255 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,34 @@ jobs:
# run on a larger runner for more SSD/resource access
runs-on: ubuntu-22.04-4core-spin
if: ${{ github.repository_owner == 'fermyon' }}
needs: build-rust-ubuntu
steps:
- uses: actions/checkout@v3

- name: Retrieve saved Spin Binary
uses: actions/download-artifact@v3
# Install all the toolchain dependencies
- name: Install Rust wasm target
run: rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
- uses: goto-bus-stop/setup-zig@v2
- uses: actions/setup-go@v4
with:
name: spin-ubuntu-latest
path: target/release/

- name: Build e2e tests image
go-version: '1.20.1'
- uses: acifani/setup-tinygo@v2
with:
tinygo-version: '0.27.0'
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install Swift
run: |
wget https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.8-SNAPSHOT-2023-02-24-a/swift-wasm-5.8-SNAPSHOT-2023-02-24-a-ubuntu22.04_x86_64.tar.gz
tar -xf swift-wasm-5.8-SNAPSHOT-2023-02-24-a-ubuntu22.04_x86_64.tar.gz
echo "$PWD/swift-wasm-5.8-SNAPSHOT-2023-02-24-a/usr/bin" >> $GITHUB_PATH
- name: Install Grain
run: |
export E2E_FETCH_SPIN=false
make build-test-spin-up
wget https://github.com/grain-lang/grain/releases/download/grain-v0.5.4/grain-linux-x64
chmod +x grain-linux-x64
mv grain-linux-x64 grain
echo "$PWD" >> $GITHUB_PATH
- name: Run e2e tests
run: |
chmod +x `pwd`/target/release/spin
export E2E_VOLUME_MOUNT="-v `pwd`/target/release/spin:/usr/local/bin/spin"
make run-test-spin-up
make test-spin-up
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,8 @@ test-integration:
$(LOG_LEVEL_VAR) cargo test --test integration --no-fail-fast -- --skip spinup_tests --skip cloud_tests --nocapture

.PHONY: test-spin-up
test-spin-up: build-test-spin-up run-test-spin-up

.PHONY: build-test-spin-up
build-test-spin-up:
docker build -t spin-e2e-tests --build-arg FETCH_SPIN=$(E2E_FETCH_SPIN) --build-arg BUILD_SPIN=$(E2E_BUILD_SPIN) -f $(E2E_TESTS_DOCKERFILE) .

.PHONY: run-test-spin-up
run-test-spin-up:
REDIS_IMAGE=$(REDIS_IMAGE) MYSQL_IMAGE=$(MYSQL_IMAGE) POSTGRES_IMAGE=$(POSTGRES_IMAGE) \
BUILD_SPIN=$(E2E_BUILD_SPIN) \
docker compose -f e2e-tests-docker-compose.yml run $(E2E_SPIN_RELEASE_VOLUME_MOUNT) $(E2E_SPIN_DEBUG_VOLUME_MOUNT) e2e-tests
test-spin-up:
cargo test --release spinup_tests --no-default-features --features e2e-tests --no-fail-fast -- --nocapture

.PHONY: test-sdk-go
test-sdk-go:
Expand Down
82 changes: 0 additions & 82 deletions e2e-tests-aarch64.Dockerfile

This file was deleted.

61 changes: 0 additions & 61 deletions e2e-tests-docker-compose.yml

This file was deleted.

88 changes: 0 additions & 88 deletions e2e-tests.Dockerfile

This file was deleted.

9 changes: 8 additions & 1 deletion tests/testcases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,15 @@ pub fn bootstrap_smoke_test(
.args(new_app_args(&mut env)?);
env.run_in(&mut new_app)?;
prebuild_hook(&mut env)?;
let path = std::env::var("PATH").unwrap_or_default();
let path = if path.is_empty() {
spin_binary().parent().unwrap().display().to_string()
} else {
format!("{path}:{}", spin_binary().parent().unwrap().display())
};
let mut build = std::process::Command::new(spin_binary());
build.args(["build"]);
// Ensure `spin` is on the path
build.env("PATH", path).args(["build"]);
env.run_in(&mut build)?;
let spin_up_args = spin_up_args(&mut env)?;
let spin = testing_framework::Spin::start(&spin_binary(), &env, spin_up_args, spin_mode)?;
Expand Down

0 comments on commit 3bab43a

Please sign in to comment.