Skip to content

Commit 5b27c64

Browse files
authored
Merge pull request #30 from stackhpc/compliance-test
CI: run compliance tests
2 parents eaaf419 + 866a22d commit 5b27c64

File tree

6 files changed

+89
-21
lines changed

6 files changed

+89
-21
lines changed

.github/workflows/pull-request.yml

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
name: Pull request
33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- main
7+
pull_request:
68
jobs:
79
build:
810
runs-on: ubuntu-latest
@@ -20,3 +22,72 @@ jobs:
2022

2123
- name: Test
2224
run: make test
25+
compliance-test:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Build
32+
run: make build
33+
34+
- name: Checkout compliance test suite
35+
uses: actions/checkout@v3
36+
with:
37+
repository: stackhpc/s3-active-storage-compliance-suite
38+
path: compliance
39+
40+
- name: Setup python
41+
uses: actions/setup-python@v4
42+
43+
- name: Install compliance test suite dependencies
44+
run: pip install -r requirements.txt
45+
working-directory: compliance
46+
47+
- name: Configure compliance test suite
48+
run: |
49+
echo 'PROXY_URL = "http://localhost:8080"' >> compliance/config.py
50+
working-directory: compliance
51+
52+
- name: Start minio object storage
53+
run: scripts/minio-start
54+
55+
- name: Wait for minio object storage to start
56+
run: |
57+
until curl -if http://localhost:9001; do
58+
sleep 1;
59+
done
60+
61+
- name: Run active storage container
62+
run: make run
63+
64+
- name: Wait for active storage server to start
65+
run: |
66+
until curl -if http://localhost:8080/.well-known/s3-active-storage-schema; do
67+
sleep 1;
68+
done
69+
70+
- name: Create artifacts directory
71+
run: mkdir artifacts
72+
73+
- name: Run compliance test suite
74+
run: pytest -s > artifacts/pytest.log
75+
76+
- name: Get active storage logs
77+
run: docker logs s3-active-storage > artifacts/s3-active-storage.log
78+
if: always()
79+
80+
- name: Upload artifacts
81+
uses: actions/upload-artifact@v3
82+
with:
83+
name: compliance-test
84+
path: artifacts
85+
if: always()
86+
87+
- name: Stop minio object storage
88+
run: scripts/minio-stop
89+
if: always()
90+
91+
- name: Stop active storage container
92+
run: make stop
93+
if: always()

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@ RUN cargo install --path .
1010

1111
# Stage 2: final image
1212
FROM debian:bullseye-slim
13+
# AWS SDK requires CA certificates to be present.
14+
RUN apt update \
15+
&& apt install -y --no-install-recommends ca-certificates \
16+
&& update-ca-certificates
1317
COPY --from=builder /usr/local/cargo/bin/s3-active-storage /usr/local/bin/s3-active-storage
1418
CMD ["s3-active-storage"]

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ test:
1010

1111
.PHONY: run
1212
run:
13-
@docker run -it --rm --net=host --name s3-active-storage s3-active-storage
13+
@docker run -it --detach --rm --net=host --name s3-active-storage s3-active-storage
14+
15+
.PHONY: stop
16+
stop:
17+
@docker stop s3-active-storage

scripts/minio-run

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

scripts/minio-start

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
# Use anon storage volume so that test data is removed when container is stopped
4+
exec docker run --detach --rm -p 9000:9000 -p 9001:9001 -v :/data --name minio minio/minio server data --console-address ":9001"

scripts/minio-stop

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
exec docker stop minio

0 commit comments

Comments
 (0)