forked from floci-io/floci
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
140 lines (117 loc) · 4.26 KB
/
justfile
File metadata and controls
140 lines (117 loc) · 4.26 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
# SDK Compatibility Tests - Task Runner Configuration
# Run `just` to see available commands
set export
set dotenv-load
# Environment defaults
FLOCI_ENDPOINT := env('FLOCI_ENDPOINT', 'http://localhost:4566')
AWS_ACCESS_KEY_ID := env('AWS_ACCESS_KEY_ID', 'test')
AWS_SECRET_ACCESS_KEY := env('AWS_SECRET_ACCESS_KEY', 'test')
AWS_DEFAULT_REGION := env('AWS_DEFAULT_REGION', 'us-east-1')
# Default recipe - list all available commands
default:
@just --list
# Run all SDK tests sequentially (continues on failure)
test-all:
#!/usr/bin/env bash
set +e
failed=0
for suite in python typescript awscli java go rust; do
echo "=== Running $suite tests ==="
just test-$suite || failed=1
done
exit $failed
# Run Python SDK tests (JUnit XML output)
[working-directory: 'sdk-test-python']
test-python:
pytest tests/ --junit-xml=test-results/junit.xml
# Run TypeScript SDK tests (JUnit XML output via vitest junit reporter)
[working-directory: 'sdk-test-node']
test-typescript:
npm test
# Run AWS CLI tests (JUnit XML output via bats)
test-awscli:
./lib/run-bats-with-junit.sh sdk-test-awscli/test/ sdk-test-awscli/test-results/junit.xml
# Run Java SDK tests (JUnit XML output via Maven Surefire)
[working-directory: 'sdk-test-java']
test-java:
mvn test -q
# Run Go SDK tests (JUnit XML output via gotestsum)
[working-directory: 'sdk-test-go']
test-go:
gotestsum --junitfile test-results.xml ./tests/...
# Run Rust SDK tests (JUnit XML output via cargo-nextest)
[working-directory: 'sdk-test-rust']
test-rust:
cargo nextest run --profile ci
# Install all test dependencies
setup: setup-python setup-typescript setup-awscli setup-java setup-go setup-rust
# Install Python test dependencies
[working-directory: 'sdk-test-python']
setup-python:
pip install -r requirements.txt
# Install TypeScript test dependencies
[working-directory: 'sdk-test-node']
setup-typescript:
npm install
# Install Java test dependencies
[working-directory: 'sdk-test-java']
setup-java:
mvn dependency:resolve -q
# Install Go test dependencies
[working-directory: 'sdk-test-go']
setup-go:
go mod download
go install gotest.tools/gotestsum@latest
# Install Rust test dependencies
[working-directory: 'sdk-test-rust']
setup-rust:
cargo fetch
cargo install cargo-nextest --locked
# Install AWS CLI test dependencies (uses shared bats from repo root)
setup-awscli: setup-bats
@echo "AWS CLI test dependencies ready (using shared bats)"
# Install bats-core and helpers for compat tests
setup-bats:
#!/usr/bin/env bash
set -euo pipefail
mkdir -p lib
if [ ! -d "lib/bats-core" ]; then
echo "Cloning bats-core..."
git clone --depth 1 https://github.com/bats-core/bats-core.git lib/bats-core
fi
if [ ! -d "lib/bats-support" ]; then
echo "Cloning bats-support..."
git clone --depth 1 https://github.com/bats-core/bats-support.git lib/bats-support
fi
if [ ! -d "lib/bats-assert" ]; then
echo "Cloning bats-assert..."
git clone --depth 1 https://github.com/bats-core/bats-assert.git lib/bats-assert
fi
echo "Bats dependencies installed!"
# Run CDK compatibility tests (JUnit XML output via bats)
test-cdk:
./lib/run-bats-with-junit.sh compat-cdk/test/ compat-cdk/test-results/junit.xml
# Run Terraform compatibility tests (JUnit XML output via bats)
test-terraform:
./lib/run-bats-with-junit.sh compat-terraform/test/ compat-terraform/test-results/junit.xml
# Run OpenTofu compatibility tests (JUnit XML output via bats)
test-opentofu:
./lib/run-bats-with-junit.sh compat-opentofu/test/ compat-opentofu/test-results/junit.xml
# Run all IaC compatibility tests (continues on failure)
test-compat:
#!/usr/bin/env bash
set +e
failed=0
for suite in cdk terraform opentofu; do
echo "=== Running $suite tests ==="
just test-$suite || failed=1
done
exit $failed
# Remove build artifacts and dependencies
clean:
rm -rf sdk-test-python/__pycache__ sdk-test-python/.pytest_cache sdk-test-python/test-results
rm -rf sdk-test-node/node_modules sdk-test-node/dist sdk-test-node/test-results
rm -rf sdk-test-java/target
rm -rf sdk-test-go/test-results.xml
rm -rf sdk-test-rust/target
rm -rf lib/bats-core lib/bats-support lib/bats-assert