From 9ab3587cf69e152b3bb1cce0ebb5a37e90ec4e8d Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 4 Apr 2023 12:34:21 +0200 Subject: [PATCH 1/3] remove ubuntu-18.04 from e2e --- .github/workflows/test-pypy.yml | 4 ++-- .github/workflows/test-python.yml | 30 ++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-pypy.yml b/.github/workflows/test-pypy.yml index ed9e46faa..c88332d91 100644 --- a/.github/workflows/test-pypy.yml +++ b/.github/workflows/test-pypy.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest] + os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-latest] pypy: - 'pypy-2.7' - 'pypy-3.7' @@ -73,7 +73,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest] + os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-latest] pypy: ['pypy2.7', 'pypy3.7', 'pypy3.8', 'pypy3.9-nightly'] steps: diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 333f11cf6..eda6cd6d8 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -20,8 +20,17 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.1] + os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04] + python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] + exclude: + - os: ubuntu-22.04 + python: 3.5.4 + - os: ubuntu-22.04 + python: 3.6.4 + - os: ubuntu-22.04 + python: 3.7.4 + - os: windows-latest + python: 3.8.15 steps: - name: Checkout uses: actions/checkout@v3 @@ -55,8 +64,17 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] - python: [3.5.4, 3.6.7, 3.7.5, 3.8.1] + os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04] + python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] + exclude: + - os: ubuntu-22.04 + python: 3.5.4 + - os: ubuntu-22.04 + python: 3.6.4 + - os: ubuntu-22.04 + python: 3.7.4 + - os: windows-latest + python: 3.8.15 steps: - name: Checkout uses: actions/checkout@v3 @@ -93,7 +111,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] + os: [macos-latest, windows-latest, ubuntu-20.04] steps: - name: Checkout uses: actions/checkout@v3 @@ -184,7 +202,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] + os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04] python: ['3.7', '3.8', '3.9', '3.10'] steps: - name: Checkout From 978873d6066596ff6c8b07e792d5b0e811bc4a87 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 4 Apr 2023 13:11:39 +0200 Subject: [PATCH 2/3] fix versions --- .github/workflows/test-python.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index eda6cd6d8..6dbd5a981 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -26,9 +26,9 @@ jobs: - os: ubuntu-22.04 python: 3.5.4 - os: ubuntu-22.04 - python: 3.6.4 + python: 3.6.7 - os: ubuntu-22.04 - python: 3.7.4 + python: 3.7.5 - os: windows-latest python: 3.8.15 steps: @@ -70,9 +70,9 @@ jobs: - os: ubuntu-22.04 python: 3.5.4 - os: ubuntu-22.04 - python: 3.6.4 + python: 3.6.7 - os: ubuntu-22.04 - python: 3.7.4 + python: 3.7.5 - os: windows-latest python: 3.8.15 steps: From 30fcc527a52148e9910589532f4a9cf3c772a645 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 4 Apr 2023 14:43:20 +0200 Subject: [PATCH 3/3] add mock for tests --- __tests__/cache-restore.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index 814999034..b4b48ad21 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -163,6 +163,12 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py fileHash, cachePaths ) => { + restoreCacheSpy.mockImplementation( + (cachePaths: string[], primaryKey: string, restoreKey?: string) => { + return primaryKey.includes(fileHash) ? primaryKey : ''; + } + ); + const cacheDistributor = getCacheDistributor( packageManager, pythonVersion,