Skip to content

Commit 604fdcf

Browse files
authored
Refactor conformance test execution to use Makefile and profiles (#173)
1 parent 1ccfa5f commit 604fdcf

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

.github/workflows/scala.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ jobs:
4040
matrix:
4141
config:
4242
- name: Netty Server
43-
args: --build-arg launcher=NettyServerLauncher --build-arg config=suite-netty.yaml
43+
profile: netty-server
4444
- name: Http4s Server
45-
args: --build-arg launcher=Http4sServerLauncher --build-arg config=suite-http4s.yaml
45+
profile: http4s-server
4646
- name: Http4s Server (non-stable)
47-
args: --build-arg launcher=Http4sServerLauncher --build-arg config=suite-http4s-nonstable.yaml --build-arg stable=false
47+
profile: http4s-server-nonstable
4848
- name: Http4s Client
49-
args: --build-arg launcher=Http4sClientLauncher --build-arg config=suite-http4s-client.yaml --build-arg mode=client
49+
profile: http4s-client
5050

5151
steps:
5252
- name: Checkout repository
5353
uses: actions/checkout@v4
5454

5555
- name: Run conformance tests for ${{ matrix.config.name }}
56-
run: docker build -f build/conformance/Dockerfile . --progress=plain ${{ matrix.config.args }}
56+
run: make test-conformance PROFILE=${{ matrix.config.profile }}
5757

5858
dependency-graph:
5959
name: Update Dependency Graph

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: test-conformance
2+
3+
# Define common variables
4+
DOCKER_BUILD_CMD = docker build -f build/conformance/Dockerfile . --progress=plain
5+
6+
test-conformance:
7+
@echo "Running conformance tests with profile: $(PROFILE)"
8+
ifeq ($(PROFILE),netty-server)
9+
$(DOCKER_BUILD_CMD) --build-arg launcher=NettyServerLauncher --build-arg config=suite-netty.yaml
10+
else ifeq ($(PROFILE),http4s-server)
11+
$(DOCKER_BUILD_CMD) --build-arg launcher=Http4sServerLauncher --build-arg config=suite-http4s.yaml
12+
else ifeq ($(PROFILE),http4s-server-nonstable)
13+
$(DOCKER_BUILD_CMD) --build-arg launcher=Http4sServerLauncher --build-arg config=suite-http4s-nonstable.yaml --build-arg stable=false
14+
else ifeq ($(PROFILE),http4s-client)
15+
$(DOCKER_BUILD_CMD) --build-arg launcher=Http4sClientLauncher --build-arg config=suite-http4s-client.yaml --build-arg mode=client
16+
else
17+
@echo "Error: Unknown profile '$(PROFILE)'. Supported profiles: netty-server, http4s-server, http4s-server-nonstable, http4s-client."
18+
@exit 1
19+
endif

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,13 @@ Run the following command to run Connect-RPC conformance tests:
261261
For the Netty server:
262262

263263
```shell
264-
docker build -f build/conformance/Dockerfile . --progress=plain --output "out" \
265-
--build-arg launcher=NettyServerLauncher --build-arg config=suite-netty.yaml
264+
make test-conformance PROFILE=netty-server
266265
```
267266

268267
For the Http4s server:
269268

270269
```shell
271-
docker build -f build/conformance/Dockerfile . --progress=plain --output "out" \
272-
--build-arg launcher=Http4sServerLauncher --build-arg config=suite-http4s.yaml
270+
make test-conformance PROFILE=http4s-server
273271
```
274272

275273
Execution results are output to STDOUT.

0 commit comments

Comments
 (0)