Skip to content

Commit

Permalink
Rework pipenv caching test (#375)
Browse files Browse the repository at this point in the history
* Rework python-pipenv-dependencies-caching test

* Update Pipfile.lock hash in the tests

* Rework python-pipenv-dependencies-caching-path test

* Set location for pipenv test

* Remove requests package from tests

* Test pipenv without caching

* Enable pipenv cache
  • Loading branch information
Vladimir Safonkin authored Apr 4, 2022
1 parent 9c644ca commit 7885ec3
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 266 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/e2e-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.7-v7.x']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: ./
with:
Expand All @@ -41,7 +41,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.7-v7.x']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: ./
with:
Expand All @@ -50,7 +50,9 @@ jobs:
- name: Install pipenv
run: pipx install pipenv
- name: Install dependencies
run: pipenv install numpy
run: |
cd __tests__/data
pipenv install --verbose
python-poetry-dependencies-caching:
name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
Expand All @@ -61,7 +63,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.7-v7.x']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python
Expand All @@ -83,7 +85,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.7-v7.x']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: ./
with:
Expand All @@ -102,14 +104,16 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', 'pypy-3.7-v7.x']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: ./
with:
python-version: ${{ matrix.python-version }}
cache: 'pipenv'
cache-dependency-path: '**/requirements-linux.txt'
cache-dependency-path: '**/pipenv-requirements.txt'
- name: Install pipenv
run: pipx install pipenv
- name: Install dependencies
run: pipenv install numpy
run: |
cd __tests__/data
pipenv install --verbose
2 changes: 1 addition & 1 deletion __tests__/cache-restore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {getCacheDistributor} from '../src/cache-distributions/cache-factory';

describe('restore-cache', () => {
const pipFileLockHash =
'67d817abcde9c72da0ed5b8f235647cb14638b9ff9d742b42e4406d2eb16fe3c';
'd1dd6218299d8a6db5fc2001d988b34a8b31f1e9d0bb4534d377dde7c19f64b3';
const requirementsHash =
'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121';
const requirementsLinuxHash =
Expand Down
2 changes: 1 addition & 1 deletion __tests__/cache-save.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {State} from '../src/cache-distributions/cache-distributor';

describe('run', () => {
const pipFileLockHash =
'67d817abcde9c72da0ed5b8f235647cb14638b9ff9d742b42e4406d2eb16fe3c';
'd1dd6218299d8a6db5fc2001d988b34a8b31f1e9d0bb4534d377dde7c19f64b3';
const requirementsHash =
'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121';
const requirementsLinuxHash =
Expand Down
13 changes: 13 additions & 0 deletions __tests__/data/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
numpy = "1.22.3"
pandas = "1.4.2"

[dev-packages]

[requires]
python_version = "*"
Loading

0 comments on commit 7885ec3

Please sign in to comment.