From 6072d657e00423f0d1537a4ab4be8e632098d478 Mon Sep 17 00:00:00 2001 From: longyuqing112 <2631918708@qq.com> Date: Wed, 12 Jun 2024 15:39:15 +0800 Subject: [PATCH] create-allure-report --- .github/workflows/main.yaml | 24 +++++++++++++++++++++--- README.md | 20 +++++++++++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3278881..4c7e0c1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -51,18 +51,36 @@ jobs: run: | cd ${{ github.workspace }}/main-repo xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' pytest -v -s ./script --alluredir=./reports/allure-results + env: + LANG: zh_CN.UTF-8 - name: Upload Allure results to Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: allure-results path: ${{ github.workspace }}/main-repo/reports/allure-results + - name: Checkout gh-pages for report history + uses: actions/checkout@v4 + with: + ref: gh-pages + path: gh-pages + # Optional: Serve Allure report - name: Serve Allure report uses: simple-elf/allure-report-action@v1.9 with: - results_directory: ${{ github.workspace }}/main-repo/reports/allure-results - allure_version: '2.13.9' # Specify Allure version if needed + allure_results: main-repo/reports/allure-results + gh_pages: gh-pages + allure_report: main-repo/reports/allure-report + allure_history: gh-pages/allure-history + env: + LANG: zh_CN.UTF-8 + - name: Deploy report to Github Pages + uses: peaceiris/actions-gh-pages@v2 + env: + PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PUBLISH_BRANCH: gh-pages + PUBLISH_DIR: gh-pages/allure-history diff --git a/README.md b/README.md index 311e886..976f863 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,18 @@ To run all test cases in the suite: pytest -v -s ./script ``` +## Running Allure-report + +To run all test cases in the suite: +1. Open your Git testing environment. +2. Execute the following command: + ``` + pytest --alluredir=./reports/allure-results + ``` + ``` + allure serve ./reports/allure-results + ``` + #### 4. Install OpenIM Server Test @@ -59,11 +71,13 @@ git clone https://github.com/openimsdk/openim-docker cd openim-docker ``` -init config: +edit env: ``` -make init +MINIO_EXTERNAL_ADDRESS="http://external_ip:10005" +GRAFANA_URL="http://external_ip:13000/" ``` + start docker: ``` docker compose up -d @@ -73,7 +87,7 @@ start test-e2e: ``` cd .. cd test-e2e -pytest main.py +pytest -v -s ./script ``` ### Using the Headless Browser in Code