-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
144 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ console/atest-ui/dist | |
.git/ | ||
bin/ | ||
dist/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM ghcr.io/linuxsuren/api-testing:master | ||
|
||
WORKDIR /workspace | ||
COPY e2e/* . | ||
COPY helm/api-testing api-testing | ||
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | ||
RUN chmod 700 get_helm.sh | ||
RUN ./get_helm.sh | ||
RUN chmod +x entrypoint.sh | ||
RUN chmod +x k8s.sh | ||
|
||
CMD [ "/workspace/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version: '3.1' | ||
services: | ||
testing: | ||
build: | ||
context: .. | ||
dockerfile: e2e/Dockerfile | ||
command: [ "/workspace/k8s.sh" ] | ||
depends_on: | ||
server: | ||
condition: service_started | ||
links: | ||
- server | ||
- agent | ||
volumes: | ||
- k8s:/root/.kube | ||
|
||
server: | ||
image: "rancher/k3s:${K3S_VERSION:-v1.25.15-k3s2}" | ||
command: server | ||
tmpfs: | ||
- /run | ||
- /var/run | ||
ulimits: | ||
nproc: 65535 | ||
nofile: | ||
soft: 65535 | ||
hard: 65535 | ||
privileged: true | ||
restart: always | ||
environment: | ||
- K3S_TOKEN=abcd | ||
- K3S_KUBECONFIG_OUTPUT=/output/config | ||
- K3S_KUBECONFIG_MODE=666 | ||
volumes: | ||
- k8s:/output | ||
# This is just so that we get the kubeconfig file out | ||
# - .:/output | ||
ports: | ||
- 30000:30000 | ||
# - 6443:6443 # Kubernetes API Server | ||
# - 80:80 # Ingress controller port 80 | ||
# - 443:443 # Ingress controller port 443 | ||
healthcheck: | ||
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/6443"] | ||
interval: 3s | ||
timeout: 30s | ||
retries: 10 | ||
start_period: 3s | ||
|
||
agent: | ||
image: "rancher/k3s:${K3S_VERSION:-v1.25.15-k3s2}" | ||
tmpfs: | ||
- /run | ||
- /var/run | ||
ulimits: | ||
nproc: 65535 | ||
nofile: | ||
soft: 65535 | ||
hard: 65535 | ||
privileged: true | ||
restart: always | ||
environment: | ||
- K3S_URL=https://server:6443 | ||
- K3S_TOKEN=abcd | ||
links: | ||
- server | ||
|
||
volumes: | ||
k8s: {} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
sleep 6 | ||
echo "Running k8s.sh" | ||
helm install --kube-apiserver https://server:6443 --kube-token abcd --kube-insecure-skip-tls-verify \ | ||
api-testing ./api-testing \ | ||
--set service.type=NodePort \ | ||
--set service.nodePort=30000 \ | ||
--set persistence.enabled=false \ | ||
--set image.repository=linuxsuren.docker.scarf.sh/linuxsuren/api-testing \ | ||
--set image.tag=master | ||
|
||
SERVER=http://server:30000 atest run -p git.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
file=$1 | ||
if [ "$file" == "" ] | ||
then | ||
file=compose.yaml | ||
fi | ||
|
||
docker-compose version | ||
docker-compose -f "$file" up --build -d | ||
|
||
while true | ||
do | ||
docker-compose -f "$file" ps | grep testing | ||
if [ $? -eq 1 ] | ||
then | ||
code=-1 | ||
docker-compose -f "$file" logs | grep e2e-testing | ||
docker-compose -f "$file" logs | grep e2e-testing | grep Usage | ||
if [ $? -eq 1 ] | ||
then | ||
code=0 | ||
echo "successed" | ||
fi | ||
|
||
docker-compose -f "$file" down | ||
set -e | ||
exit $code | ||
fi | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters