Skip to content

Commit bbbb59b

Browse files
authored
Merge pull request #2224 from fermyon/more-e2e
Move rest of e2e tests over to new testing framework
2 parents 7a6b81b + 3bab43a commit bbbb59b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+918
-4988
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
**/target
22
**/node_modules
3-
tests/testcases/*-generated
43
**/spin-plugin-update.lock
54
**/package-lock.json

.github/workflows/build.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: BUILD_SPIN_EXAMPLES=0 make lint
4343

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

4747
- name: Cancel everything if linting fails
4848
if: failure()
@@ -197,23 +197,34 @@ jobs:
197197
# run on a larger runner for more SSD/resource access
198198
runs-on: ubuntu-22.04-4core-spin
199199
if: ${{ github.repository_owner == 'fermyon' }}
200-
needs: build-rust-ubuntu
201200
steps:
202201
- uses: actions/checkout@v3
203202

204-
- name: Retrieve saved Spin Binary
205-
uses: actions/download-artifact@v3
203+
# Install all the toolchain dependencies
204+
- name: Install Rust wasm target
205+
run: rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
206+
- uses: goto-bus-stop/setup-zig@v2
207+
- uses: actions/setup-go@v4
206208
with:
207-
name: spin-ubuntu-latest
208-
path: target/release/
209-
210-
- name: Build e2e tests image
209+
go-version: '1.20.1'
210+
- uses: acifani/setup-tinygo@v2
211+
with:
212+
tinygo-version: '0.27.0'
213+
- uses: actions/setup-node@v3
214+
with:
215+
node-version: '16.x'
216+
- name: Install Swift
217+
run: |
218+
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
219+
tar -xf swift-wasm-5.8-SNAPSHOT-2023-02-24-a-ubuntu22.04_x86_64.tar.gz
220+
echo "$PWD/swift-wasm-5.8-SNAPSHOT-2023-02-24-a/usr/bin" >> $GITHUB_PATH
221+
- name: Install Grain
211222
run: |
212-
export E2E_FETCH_SPIN=false
213-
make build-test-spin-up
223+
wget https://github.com/grain-lang/grain/releases/download/grain-v0.5.4/grain-linux-x64
224+
chmod +x grain-linux-x64
225+
mv grain-linux-x64 grain
226+
echo "$PWD" >> $GITHUB_PATH
214227
215228
- name: Run e2e tests
216229
run: |
217-
chmod +x `pwd`/target/release/spin
218-
export E2E_VOLUME_MOUNT="-v `pwd`/target/release/spin:/usr/local/bin/spin"
219-
make run-test-spin-up
230+
make test-spin-up

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ main.wasm
77
.parcel-cache
88
.vscode/*.log
99
crates/**/Cargo.lock
10-
tests/testcases/*-generated
1110
spin-plugin-update.lock
1211
package-lock.json
1312
.spin

Cargo.lock

Lines changed: 1 addition & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ hex = "0.4.3"
8888
hyper = { workspace = true }
8989
sha2 = "0.10.1"
9090
which = "4.2.5"
91-
e2e-testing = { path = "crates/e2e-testing" }
9291
http-body-util = { workspace = true }
9392
testing-framework = { path = "tests/testing-framework" }
9493
hyper-util = { version = "0.1.2", features = ["tokio"] }

Makefile

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ lint:
6262
cargo clippy --all --all-targets --features all-tests -- -D warnings
6363
cargo fmt --all -- --check
6464

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

7575
.PHONY: lint-all
76-
lint-all: lint lint-rust-examples-and-testcases
76+
lint-all: lint lint-rust-examples
7777

7878
## Bring all of the checked in `Cargo.lock` files up-to-date
7979
.PHONY: update-cargo-locks
8080
update-cargo-locks:
8181
echo "Updating Cargo.toml"
8282
cargo update -w --offline; \
83-
for manifest_path in $$(find examples tests/testcases -name Cargo.toml); do \
83+
for manifest_path in $$(find examples -name Cargo.toml); do \
8484
echo "Updating $${manifest_path}" && \
8585
cargo update --manifest-path "$${manifest_path}" -w --offline; \
8686
done
@@ -99,17 +99,8 @@ test-integration:
9999
$(LOG_LEVEL_VAR) cargo test --test integration --no-fail-fast -- --skip spinup_tests --skip cloud_tests --nocapture
100100

101101
.PHONY: test-spin-up
102-
test-spin-up: build-test-spin-up run-test-spin-up
103-
104-
.PHONY: build-test-spin-up
105-
build-test-spin-up:
106-
docker build -t spin-e2e-tests --build-arg FETCH_SPIN=$(E2E_FETCH_SPIN) --build-arg BUILD_SPIN=$(E2E_BUILD_SPIN) -f $(E2E_TESTS_DOCKERFILE) .
107-
108-
.PHONY: run-test-spin-up
109-
run-test-spin-up:
110-
REDIS_IMAGE=$(REDIS_IMAGE) MYSQL_IMAGE=$(MYSQL_IMAGE) POSTGRES_IMAGE=$(POSTGRES_IMAGE) \
111-
BUILD_SPIN=$(E2E_BUILD_SPIN) \
112-
docker compose -f e2e-tests-docker-compose.yml run $(E2E_SPIN_RELEASE_VOLUME_MOUNT) $(E2E_SPIN_DEBUG_VOLUME_MOUNT) e2e-tests
102+
test-spin-up:
103+
cargo test --release spinup_tests --no-default-features --features e2e-tests --no-fail-fast -- --nocapture
113104

114105
.PHONY: test-sdk-go
115106
test-sdk-go:

crates/e2e-testing/Cargo.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

crates/e2e-testing/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

crates/e2e-testing/src/asserts.rs

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)