Переглянути джерело

fix(test): coverage override data on each test

wangweimin 5 роки тому
батько
коміт
f161ab9871
3 змінених файлів з 20 додано та 18 видалено
  1. 17 0
      .github/workflows/sync_repo.yml
  2. 2 17
      .github/workflows/test.yml
  3. 1 1
      test/util.py

+ 17 - 0
.github/workflows/sync_repo.yml

@@ -0,0 +1,17 @@
+name: Sync with mirror repo
+on: push
+jobs:
+  sync:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@master
+      - name: Push
+        run: |
+          git fetch --unshallow origin
+          git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git"
+          git config credential.helper '!f() { sleep 1; echo "username=${ALIYUN_GIT_USER}"; echo "password=${ALIYUN_GIT_PASSWORD}"; }; f'
+          git push -f -u aliyun --tags
+        env:
+          ALIYUN_GIT_USER: ${{ secrets.ALIYUN_GIT_USER }}
+          ALIYUN_GIT_PASSWORD: ${{ secrets.ALIYUN_GIT_PASSWORD }}

+ 2 - 17
.github/workflows/test.yml

@@ -1,4 +1,4 @@
-name: Tests and Sync
+name: Tests
 on: [push, pull_request]
 jobs:
   test:
@@ -33,19 +33,4 @@ jobs:
           path: test/output
       - name: Upload Codecov Report
         working-directory: ./test
-        run: bash <(curl -s https://codecov.io/bash)
-  sync:
-    runs-on: ubuntu-latest
-    if: github.event_name == 'push'
-    steps:
-      - name: Checkout
-        uses: actions/checkout@master
-      - name: Push
-        run: |
-          git fetch --unshallow origin
-          git remote add aliyun "https://code.aliyun.com/wang0618/pywebio.git"
-          git config credential.helper '!f() { sleep 1; echo "username=${ALIYUN_GIT_USER}"; echo "password=${ALIYUN_GIT_PASSWORD}"; }; f'
-          git push -f -u aliyun
-        env:
-          ALIYUN_GIT_USER: ${{ secrets.ALIYUN_GIT_USER }}
-          ALIYUN_GIT_PASSWORD: ${{ secrets.ALIYUN_GIT_PASSWORD }}
+        run: bash <(curl -s https://codecov.io/bash)

+ 1 - 1
test/util.py

@@ -47,7 +47,7 @@ def run_test(server_func, test_func, port=8080, chrome_options=None):
 
     if sys.argv[-1] == 'auto':
         default_chrome_options.add_argument('--headless')
-        proc = subprocess.Popen(['coverage', 'run', '--source', 'pywebio',
+        proc = subprocess.Popen(['coverage', 'run', '--source', 'pywebio', '--append',
                                  sys.argv[0]], stdout=sys.stdout, stderr=subprocess.STDOUT, text=True)
     elif sys.argv[-1] == 'debug':
         proc = subprocess.Popen(['python3', sys.argv[0]], stdout=sys.stdout, stderr=subprocess.STDOUT, text=True)