run gdrive tests in a single job, run all on schedule (#5974)

This commit is contained in:
Saugat Pachhai
2021-05-06 17:09:34 +05:45
committed by GitHub
parent 597f730e7d
commit eabf6ddf27
2 changed files with 13 additions and 10 deletions
+12 -1
View File
@@ -7,6 +7,8 @@ on:
push:
branches:
- master
schedule:
- cron: '5 1 * * *' # every day at 01:05
env:
DVC_TEST: "true"
@@ -87,12 +89,21 @@ jobs:
run: |
mkdir -p scripts/ci
echo "$GS_CREDS_JSON" > scripts/ci/gcp-creds.json
- name: disable gdrive tests
if: >-
github.event_name != 'schedule' &&
(matrix.pyv != '3.8' || matrix.os != 'ubuntu-18.04')
run: |
echo "extra_test_args=--disable-gdrive" >> $GITHUB_ENV
- name: run tests
env:
GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: python -m tests --all --cov-report=xml --cov-report=term -n=4
run: >-
python -m tests -n=4
--cov-report=xml --cov-report=term
--all ${{ env.extra_test_args }}
- name: upload coverage report
uses: codecov/[email protected]
with:
+1 -9
View File
@@ -266,18 +266,10 @@ def make_tmp_dir(tmp_path_factory, request, worker_id):
def make(name, *, scm=False, dvc=False, subdir=False):
from dvc.repo import Repo
from dvc.scm.git import Git
from dvc.utils.fs import fs_copy
cache = CACHE.get((scm, dvc, subdir))
if not cache:
cache = tmp_path_factory.mktemp("dvc-test-cache" + worker_id)
TmpDir(cache).init(scm=scm, dvc=dvc, subdir=subdir)
CACHE[(scm, dvc, subdir)] = os.fspath(cache)
path = tmp_path_factory.mktemp(name) if isinstance(name, str) else name
for entry in os.listdir(cache):
# shutil.copytree's dirs_exist_ok is only available in >=3.8
fs_copy(os.path.join(cache, entry), os.path.join(path, entry))
new_dir = TmpDir(path)
new_dir.init(scm=scm, dvc=dvc, subdir=subdir)
str_path = os.fspath(new_dir)
if dvc:
new_dir.dvc = Repo(str_path)