diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0ebbc0ab4..5244ab93a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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/codecov-action@v1.5.0 with: diff --git a/tests/dir_helpers.py b/tests/dir_helpers.py index 9f5c17c07..c62ac0764 100644 --- a/tests/dir_helpers.py +++ b/tests/dir_helpers.py @@ -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)