-
Notifications
You must be signed in to change notification settings - Fork 8
158 lines (141 loc) · 4.77 KB
/
integration.yml
File metadata and controls
158 lines (141 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Integration Tests
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
TEST_S3_ENDPOINT: http://localhost:9000
TEST_S3_ACCESS_KEY: accesskey
TEST_S3_SECRET_KEY: secretkey
jobs:
cli-contract:
name: CLI Contract (Commands and Options)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run CLI help contract tests
run: cargo test --package rustfs-cli --test help_contract
smoke-latest:
name: Smoke (RustFS latest)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Start RustFS latest
run: |
docker run -d --name rustfs \
-p 9000:9000 \
-p 9001:9001 \
-v rustfs-data:/data \
-e RUSTFS_ROOT_USER=accesskey \
-e RUSTFS_ROOT_PASSWORD=secretkey \
-e RUSTFS_ACCESS_KEY=accesskey \
-e RUSTFS_SECRET_KEY=secretkey \
-e RUSTFS_VOLUMES=/data \
-e RUSTFS_ADDRESS=":9000" \
-e RUSTFS_CONSOLE_ENABLE="true" \
-e RUSTFS_CONSOLE_ADDRESS=":9001" \
rustfs/rustfs:latest
- name: Wait for RustFS
run: |
for i in {1..60}; do
if curl -sf http://localhost:9000/health > /dev/null 2>&1; then
echo "RustFS is ready"
exit 0
fi
sleep 1
done
echo "RustFS failed to start"
docker logs rustfs
exit 1
- name: Run smoke compatibility tests
run: |
set -euo pipefail
TESTS=(
"object_operations::test_upload_and_download_small_file"
"object_operations::test_move_recursive_prefix_s3_to_s3"
"quota_operations::test_bucket_quota_set_info_clear"
"option_behavior_operations::test_cp_dry_run_does_not_create_target_object"
"option_behavior_operations::test_head_bytes_returns_prefix_bytes"
"option_behavior_operations::test_find_print_outputs_full_remote_path"
"option_behavior_operations::test_find_exec_rejects_json_output"
"option_behavior_operations::test_mirror_parallel_zero_returns_usage_error"
)
for test_name in "${TESTS[@]}"; do
echo "==> Running $test_name"
cargo test \
--package rustfs-cli \
--test integration \
--features integration \
"$test_name" \
-- \
--exact \
--test-threads=1
done
- name: Show RustFS logs on failure
if: failure()
run: docker logs rustfs 2>&1 | tail -200
full-latest:
name: Full Integration (RustFS latest)
runs-on: ubuntu-latest
timeout-minutes: 90
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Start RustFS latest
run: |
docker run -d --name rustfs \
-p 9000:9000 \
-p 9001:9001 \
-v rustfs-data:/data \
-e RUSTFS_ROOT_USER=accesskey \
-e RUSTFS_ROOT_PASSWORD=secretkey \
-e RUSTFS_ACCESS_KEY=accesskey \
-e RUSTFS_SECRET_KEY=secretkey \
-e RUSTFS_VOLUMES=/data \
-e RUSTFS_ADDRESS=":9000" \
-e RUSTFS_CONSOLE_ENABLE="true" \
-e RUSTFS_CONSOLE_ADDRESS=":9001" \
rustfs/rustfs:latest
- name: Wait for RustFS
run: |
for i in {1..60}; do
if curl -sf http://localhost:9000/health > /dev/null 2>&1; then
echo "RustFS is ready"
exit 0
fi
sleep 1
done
echo "RustFS failed to start"
docker logs rustfs
exit 1
- name: Run full integration suite
run: cargo test --package rustfs-cli --test integration --features integration -- --test-threads=1
- name: Show RustFS logs on failure
if: failure()
run: docker logs rustfs 2>&1 | tail -200
golden:
name: Golden Tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run golden tests
run: cargo test --package rustfs-cli --test golden --features golden
env:
RC_CONFIG_DIR: ${{ runner.temp }}/rc-test-config