Skip to content

Commit 2310515

Browse files
authored
Merge pull request #19797 from nwnt/nwnt/consolidate-mod-files
Consolidate to tests's go.mod
2 parents 51e38f4 + 3cf32c0 commit 2310515

File tree

12 files changed

+40
-281
lines changed

12 files changed

+40
-281
lines changed

.github/workflows/antithesis-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ jobs:
7575
- name: Build and push client image
7676
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
7777
with:
78-
context: ./tests/antithesis/test-template
79-
file: ./tests/antithesis/test-template/Dockerfile.client
78+
context: .
79+
file: ./tests/antithesis/test-template/Dockerfile
8080
push: true
8181
tags: |
8282
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-client:latest,

bill-of-materials.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
}
1818
]
1919
},
20+
{
21+
"project": "github.com/antithesishq/antithesis-sdk-go",
22+
"licenses": [
23+
{
24+
"type": "MIT License",
25+
"confidence": 1
26+
}
27+
]
28+
},
2029
{
2130
"project": "github.com/beorn7/perks/quantile",
2231
"licenses": [

tests/antithesis/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
REPOSITORY_ROOT := $(shell git rev-parse --show-toplevel)
2+
3+
.PHONY: antithesis-build-client-docker-image
4+
antithesis-build-client-docker-image:
5+
docker build --build-arg GO_VERSION=$(shell cat $(REPOSITORY_ROOT)/.go-version) -f $(REPOSITORY_ROOT)/tests/antithesis/test-template/Dockerfile $(REPOSITORY_ROOT)
Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
1-
FROM ubuntu:latest
1+
ARG GO_VERSION=1.24.2
2+
ARG ARCH=amd64
23

3-
# Install dependencies
4-
RUN apt-get update -y && apt-get install -y pip wget
4+
FROM golang:$GO_VERSION AS builder
5+
WORKDIR /build
6+
COPY . .
57

6-
# GO:
8+
WORKDIR /build/tests
9+
RUN go build -o /opt/entrypoint -race ./antithesis/test-template/entrypoint/entrypoint.go
10+
RUN go build -o /opt/serial_driver_delete_keys -race ./antithesis/test-template/go-delete-keys/serial_driver_delete_keys.go
711

8-
# Install go
9-
RUN wget https://golang.org/dl/go1.22.5.linux-amd64.tar.gz
10-
RUN tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz
11-
ENV PATH=$PATH:/usr/local/go/bin
12-
13-
# Set working directory
14-
WORKDIR /opt/antithesis/entrypoint
15-
16-
# Copy your entrypoint script
17-
COPY ./entrypoint/go.mod ./go.mod
18-
COPY ./entrypoint/go.sum ./go.sum
19-
COPY ./entrypoint/entrypoint.go ./entrypoint.go
20-
21-
# Run go mod tidy to ensure the dependencies are correct
22-
RUN go mod tidy
23-
24-
# Building go executable and putting it in Test Composer directory
25-
RUN go build -o ./entrypoint -race
26-
27-
# Copying go script and building an executable into Test Composer directory
28-
WORKDIR /opt/antithesis/go-delete-keys
29-
30-
COPY ./go-delete-keys/go.mod ./go.mod
31-
COPY ./go-delete-keys/go.sum ./go.sum
32-
COPY ./go-delete-keys/serial_driver_delete_keys.go ./serial_driver_delete_keys.go
33-
34-
# Building go executable and putting it in Test Composer directory
35-
RUN go build -o /opt/antithesis/test/v1/main/serial_driver_delete_keys -race
12+
FROM --platform=linux/${ARCH} gcr.io/distroless/static-debian12@sha256:3d0f463de06b7ddff27684ec3bfd0b54a425149d0f8685308b1fdf297b0265e9
13+
COPY --from=builder /opt/entrypoint /opt/antithesis/entrypoint/entrypoint
14+
COPY --from=builder /opt/serial_driver_delete_keys /opt/antithesis/test/v1/main/serial_driver_delete_keys

tests/antithesis/test-template/entrypoint/entrypoint.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ func CheckHealth() bool {
4646
}
4747

4848
defer func() {
49-
if err := cli.Close(); err != nil {
50-
fmt.Printf("Client [entrypoint]: error closing connection: %v\n", err)
49+
cErr := cli.Close()
50+
if cErr != nil {
51+
fmt.Printf("Client [entrypoint]: error closing connection: %v\n", cErr)
5152
}
5253
}()
5354

tests/antithesis/test-template/entrypoint/go.mod

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

tests/antithesis/test-template/entrypoint/go.sum

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

tests/antithesis/test-template/go-delete-keys/go.mod

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

0 commit comments

Comments
 (0)