Skip to content

Commit

Permalink
Merge pull request fermyon#2224 from fermyon/more-e2e
Browse files Browse the repository at this point in the history
Move rest of e2e tests over to new testing framework
  • Loading branch information
rylev authored Jan 16, 2024
2 parents 7a6b81b + 3bab43a commit bbbb59b
Show file tree
Hide file tree
Showing 56 changed files with 918 additions and 4,988 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
**/target
**/node_modules
tests/testcases/*-generated
**/spin-plugin-update.lock
**/package-lock.json
37 changes: 24 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: BUILD_SPIN_EXAMPLES=0 make lint

- name: Run lints on examples
run: BUILD_SPIN_EXAMPLES=0 make lint-rust-examples-and-testcases
run: BUILD_SPIN_EXAMPLES=0 make lint-rust-examples

- name: Cancel everything if linting fails
if: failure()
Expand Down 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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ main.wasm
.parcel-cache
.vscode/*.log
crates/**/Cargo.lock
tests/testcases/*-generated
spin-plugin-update.lock
package-lock.json
.spin
Expand Down
39 changes: 1 addition & 38 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ hex = "0.4.3"
hyper = { workspace = true }
sha2 = "0.10.1"
which = "4.2.5"
e2e-testing = { path = "crates/e2e-testing" }
http-body-util = { workspace = true }
testing-framework = { path = "tests/testing-framework" }
hyper-util = { version = "0.1.2", features = ["tokio"] }
Expand Down
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ lint:
cargo clippy --all --all-targets --features all-tests -- -D warnings
cargo fmt --all -- --check

.PHONY: lint-rust-examples-and-testcases
lint-rust-examples-and-testcases:
for manifest_path in $$(find examples tests/testcases -name Cargo.toml); do \
.PHONY: lint-rust-examples
lint-rust-examples:
for manifest_path in $$(find examples -name Cargo.toml); do \
echo "Linting $${manifest_path}" \
&& cargo clippy --manifest-path "$${manifest_path}" -- -D warnings \
&& cargo fmt --manifest-path "$${manifest_path}" -- --check \
Expand All @@ -73,14 +73,14 @@ lint-rust-examples-and-testcases:
done

.PHONY: lint-all
lint-all: lint lint-rust-examples-and-testcases
lint-all: lint lint-rust-examples

## Bring all of the checked in `Cargo.lock` files up-to-date
.PHONY: update-cargo-locks
update-cargo-locks:
echo "Updating Cargo.toml"
cargo update -w --offline; \
for manifest_path in $$(find examples tests/testcases -name Cargo.toml); do \
for manifest_path in $$(find examples -name Cargo.toml); do \
echo "Updating $${manifest_path}" && \
cargo update --manifest-path "$${manifest_path}" -w --offline; \
done
Expand All @@ -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
21 changes: 0 additions & 21 deletions crates/e2e-testing/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions crates/e2e-testing/README.md

This file was deleted.

78 changes: 0 additions & 78 deletions crates/e2e-testing/src/asserts.rs

This file was deleted.

Loading

0 comments on commit bbbb59b

Please sign in to comment.