This is an automated email from the ASF dual-hosted git repository.
gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new 598ed2ea1 [ci] add e2e logs to debug e2e test & delete unnecessary
files (#2447)
598ed2ea1 is described below
commit 598ed2ea168338d4b4322d6fbb3c3808b14c3818
Author: YuLuo <[email protected]>
AuthorDate: Sat Aug 3 18:10:07 2024 +0800
[ci] add e2e logs to debug e2e test & delete unnecessary files (#2447)
Signed-off-by: yuluo-yx <[email protected]>
---
.github/workflows/backend-build-test.yml | 13 ++++++++++++-
e2e/Dockerfile | 23 -----------------------
e2e/{compose.yaml => docker-compose.yml} | 12 ++++++++++--
e2e/script/entrypoint.sh | 21 ---------------------
e2e/script/start.sh | 29 -----------------------------
5 files changed, 22 insertions(+), 76 deletions(-)
diff --git a/.github/workflows/backend-build-test.yml
b/.github/workflows/backend-build-test.yml
index 1124b17fd..ecf9cfa4a 100644
--- a/.github/workflows/backend-build-test.yml
+++ b/.github/workflows/backend-build-test.yml
@@ -53,6 +53,7 @@ jobs:
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
+
- name: Build Image
env:
IMAGE_PUSH: false
@@ -63,9 +64,19 @@ jobs:
docker buildx use myBuilder
./script/docker/server/build.sh
+
- name: Run E2E
run: |
sudo curl -L
https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64
-o /usr/local/bin/docker-compose
sudo chmod u+x /usr/local/bin/docker-compose
- cd e2e && chmod +x ./script/*.sh && ./script/start.sh
+ cd e2e
+ sudo docker-compose version
+ sudo docker-compose up --exit-code-from testing --remove-orphans
+
+ # upload application logs
+ - name: Upload logs
+ uses: actions/upload-artifact@v3
+ with:
+ name: hz-logs-${{ github.run_id }}
+ path: e2e/logs/
diff --git a/e2e/Dockerfile b/e2e/Dockerfile
deleted file mode 100644
index babd34881..000000000
--- a/e2e/Dockerfile
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-FROM ghcr.io/linuxsuren/api-testing:v0.0.17
-
-WORKDIR /workspace
-COPY . .
-
-CMD [ "/workspace/script/entrypoint.sh" ]
diff --git a/e2e/compose.yaml b/e2e/docker-compose.yml
similarity index 80%
rename from e2e/compose.yaml
rename to e2e/docker-compose.yml
index 7e522fbb1..b9e1b12ce 100644
--- a/e2e/compose.yaml
+++ b/e2e/docker-compose.yml
@@ -18,17 +18,25 @@
version: '3.8'
services:
testing:
- build:
- context: .
+ image: ghcr.io/linuxsuren/api-testing:v0.0.17
environment:
SERVER: http://hertzbeat:1157
+ container_name: e2e-testing
+ volumes:
+ - ./data/:/work/data/
+ - ./testsuite.yaml:/work/testsuite.yaml
+ command: atest run -p /work/testsuite.yaml --report md
depends_on:
hertzbeat:
condition: service_healthy
links:
- hertzbeat
+
hertzbeat:
image: apache/hertzbeat
+ container_name: e2e-hertzbeat
+ volumes:
+ - ./logs/:/opt/hertzbeat/logs/
ports:
- "1157:1157"
environment:
diff --git a/e2e/script/entrypoint.sh b/e2e/script/entrypoint.sh
deleted file mode 100644
index 6ddca683b..000000000
--- a/e2e/script/entrypoint.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-set -e
-
-atest run -p testsuite.yaml --report md
diff --git a/e2e/script/start.sh b/e2e/script/start.sh
deleted file mode 100644
index cb7247339..000000000
--- a/e2e/script/start.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Derived from Api Testing
https://github.com/LinuxSuRen/api-testing/blob/master/e2e/start.sh
-
-file=$1
-if [ "$file" == "" ]
-then
- file=compose.yaml
-fi
-
-docker-compose version
-docker-compose -f "$file" down
-docker-compose -f "$file" up --build testing --exit-code-from testing
--remove-orphans
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]