Skip to content

Commit 91ce14a

Browse files
committed
feat: support to get test suites with details
1 parent 345d77e commit 91ce14a

File tree

8 files changed

+445
-8
lines changed

8 files changed

+445
-8
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git/
2+
.github/

Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
FROM golang:1.20 AS builder
1+
ARG GO_BUILDER=docker.io/library/golang:1.20
2+
ARG BASE_IMAGE=docker.io/library/alpine:3.12
3+
4+
FROM ${GO_BUILDER} AS builder
25

36
ARG VERSION
47
ARG GOPROXY
58
WORKDIR /workspace
6-
COPY cmd/ cmd/
7-
COPY pkg/ pkg/
8-
COPY go.mod go.mod
9-
COPY go.sum go.sum
10-
COPY main.go main.go
11-
COPY README.md README.md
9+
COPY . .
1210

1311
RUN GOPROXY=${GOPROXY} go mod download
1412
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-orm .
1513

16-
FROM alpine:3.12
14+
FROM ${BASE_IMAGE}
1715

1816
LABEL org.opencontainers.image.source=https://github.com/LinuxSuRen/atest-ext-store-orm
1917
LABEL org.opencontainers.image.description="ORM database Store Extension of the API Testing."

e2e/Dockerfile

Whitespace-only changes.

e2e/compose.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: '3.1'
2+
services:
3+
testing:
4+
image: ghcr.io/linuxsuren/api-testing:master
5+
depends_on:
6+
mysql:
7+
condition: service_healthy
8+
volumes:
9+
- type: volume
10+
source: cache
11+
target: /var/data
12+
links:
13+
- mysql
14+
extension:
15+
build:
16+
context: ..
17+
dockerfile: Dockerfile
18+
args:
19+
- "GO_BUILDER=ghcr.io/linuxsuren/library/golang:1.20"
20+
- "BASE_IMAGE=ghcr.io/linuxsuren/library/alpine:3.12"
21+
volumes:
22+
- type: volume
23+
source: cache
24+
target: /var/data
25+
mysql:
26+
image: mysql:8.2.0
27+
command: --default-authentication-plugin=mysql_native_password
28+
environment:
29+
MYSQL_ROOT_PASSWORD: root
30+
MYSQL_DATABASE: atest
31+
healthcheck:
32+
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306"]
33+
interval: 3s
34+
timeout: 60s
35+
retries: 10
36+
start_period: 3s
37+
38+
volumes:
39+
cache:

e2e/entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
5+
mkdir -p /root/.config/atest
6+
mkdir -p /var/data
7+
8+
echo "start to run server"
9+
nohup atest server
10+
cmd="atest run -p test-suite.yaml"
11+
12+
echo "start to run testing: $cmd"
13+
kind=orm target=postgres:5432 driver=postgres $cmd
14+
15+
cat /root/.config/atest/stores.yaml

e2e/start.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
file=$1
4+
if [ "$file" == "" ]
5+
then
6+
file=compose.yaml
7+
fi
8+
9+
docker compose version
10+
docker compose -f "$file" down
11+
docker compose -f "$file" up --build testing --exit-code-from testing --remove-orphans

0 commit comments

Comments
 (0)