Skip to content

Commit 50f1c33

Browse files
authored
Merge pull request #90 from rajatjindal/use-spin-build
Run tests with spin-registry-push as well
2 parents ff0ca95 + 4e52d0e commit 50f1c33

File tree

31 files changed

+364
-62
lines changed

31 files changed

+364
-62
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444
- uses: actions/checkout@v4
4545
- uses: actions/download-artifact@v4
4646
- uses: azure/setup-kubectl@v4
47+
- uses: fermyon/actions/spin/setup@v1
48+
with:
49+
version: "v2.4.2"
50+
4751
- name: Setup build env
4852
run: |
4953
./scripts/setup-linux.sh

Makefile

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,39 @@ move-bins:
3434
up:
3535
./scripts/up.sh
3636

37+
./PHONY: teardown-workloads
38+
teardown-workloads:
39+
./scripts/teardown-workloads.sh
40+
3741
./PHONY: pod-status-check
3842
pod-status-check:
3943
./scripts/pod-status-check.sh
4044

41-
./PHONY: workloads
42-
workloads:
43-
./scripts/workloads.sh
45+
./PHONY: deploy-workloads-pushed-using-docker-build-push
46+
deploy-workloads-pushed-using-docker-build-push:
47+
./scripts/deploy-workloads.sh "workloads-pushed-using-docker-build-push"
48+
49+
./PHONY: deploy-workloads-pushed-using-spin-registry-push
50+
deploy-workloads-pushed-using-spin-registry-push:
51+
./scripts/deploy-workloads.sh "workloads-pushed-using-spin-registry-push"
4452

45-
./PHONY: test-workloads-delete
46-
test-workloads-delete:
47-
./scripts/workloads-delete.sh
53+
./PHONY: pod-terminates-test
54+
pod-terminates-test:
55+
./scripts/pod-terminates-test.sh
4856

4957
.PHONY: integration-tests
50-
integration-tests: check-bins move-bins up pod-status-check workloads test-workloads-delete
51-
cargo test -p containerd-shim-spin-tests -- --nocapture
58+
integration-tests: prepare-cluster-and-images integration-docker-build-push-tests integration-spin-registry-push-tests
59+
60+
.PHONY: integration-docker-build-push-tests
61+
integration-docker-build-push-tests:
62+
./scripts/run-integration-tests.sh "workloads-pushed-using-docker-build-push"
63+
64+
.PHONY: integration-spin-registry-push-tests pod-terminates-test
65+
integration-spin-registry-push-tests:
66+
./scripts/run-integration-tests.sh "workloads-pushed-using-spin-registry-push"
5267

68+
.PHONY: prepare-cluster-and-images
69+
prepare-cluster-and-images: check-bins move-bins up pod-status-check
5370
.PHONY: tests/collect-debug-logs
5471
tests/collect-debug-logs:
5572
./scripts/collect-debug-logs.sh 2>&1

images/spin-inbound-redis/Cargo.lock

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

images/spin-inbound-redis/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ COPY . .
44
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release
55

66
FROM scratch
7-
COPY --from=build /opt/build/target/wasm32-wasi/release/spin_inbound_redis.wasm .
7+
COPY --from=build /opt/build/target/wasm32-wasi/release/spin_inbound_redis.wasm ./target/wasm32-wasi/release/spin_inbound_redis.wasm
88
COPY --from=build /opt/build/spin.toml .

images/spin-inbound-redis/spin.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ address = "{{ redis_address }}"
1414
component = "hello"
1515

1616
[component.hello]
17-
source = "spin_inbound_redis.wasm"
17+
source = "target/wasm32-wasi/release/spin_inbound_redis.wasm"
1818
allowed_outbound_hosts = ["redis://*:*"]
1919

20+
[component.hello.build]
21+
command = "cargo build --target wasm32-wasi --release"
22+
2023
[component.hello.variables]
2124
redis_address = "{{ redis_address }}"
2225
redis_channel = "{{ redis_channel }}"

images/spin-multi-trigger-app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ WORKDIR /opt/build/spin-redis-trigger
1010
RUN cargo build --target wasm32-wasi --release
1111

1212
FROM scratch
13-
COPY --from=build /opt/build/spin-http-trigger/target/wasm32-wasi/release/spin_http_trigger.wasm .
14-
COPY --from=build /opt/build/spin-redis-trigger/target/wasm32-wasi/release/spin_redis_trigger.wasm .
13+
COPY --from=build /opt/build/spin-http-trigger/target/wasm32-wasi/release/spin_http_trigger.wasm spin-http-trigger/target/wasm32-wasi/release/spin_http_trigger.wasm
14+
COPY --from=build /opt/build/spin-redis-trigger/target/wasm32-wasi/release/spin_redis_trigger.wasm spin-redis-trigger/target/wasm32-wasi/release/spin_redis_trigger.wasm
1515
COPY --from=build /opt/build/spin.toml .

images/spin-multi-trigger-app/spin-http-trigger/Cargo.lock

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

images/spin-multi-trigger-app/spin-redis-trigger/Cargo.lock

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

images/spin-multi-trigger-app/spin.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ route = "/..."
1111
component = "spin-http-trigger"
1212

1313
[component.spin-http-trigger]
14-
source = "spin_http_trigger.wasm"
14+
source = "spin-http-trigger/target/wasm32-wasi/release/spin_http_trigger.wasm"
1515
allowed_outbound_hosts = []
1616
[component.spin-http-trigger.build]
17-
command = "cargo build --target wasm32-wasi --release"
17+
command = "cargo build --target wasm32-wasi --release --manifest-path spin-http-trigger/Cargo.toml"
1818
watch = ["src/**/*.rs", "Cargo.toml"]
1919

2020
[application.trigger.redis]
@@ -25,7 +25,7 @@ channel = "testchannel"
2525
component = "spin-redis-trigger"
2626

2727
[component.spin-redis-trigger]
28-
source = "spin_redis_trigger.wasm"
28+
source = "spin-redis-trigger/target/wasm32-wasi/release/spin_redis_trigger.wasm"
2929
allowed_outbound_hosts = ["redis://redis-service.default.svc.cluster.local:6379"]
3030
[component.spin-redis-trigger.build]
31-
command = "cargo build --target wasm32-wasi --release"
31+
command = "cargo build --target wasm32-wasi --release --manifest-path spin-redis-trigger/Cargo.toml"

images/spin-outbound-redis/Cargo.lock

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

0 commit comments

Comments
 (0)