Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan@danryan.co>

Fix windows testing

Signed-off-by: Dan Ryan <dan@danryan.co>

Update runner

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix powershell script

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix git ssl issues

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix test name

Signed-off-by: Dan Ryan <dan@danryan.co>

Update test publication

Signed-off-by: Dan Ryan <dan@danryan.co>

Only run py36 py37 and py27 for testing

Signed-off-by: Dan Ryan <dan@danryan.co>

Enable linux builds

Signed-off-by: Dan Ryan <dan@danryan.co>

triple parallel

Signed-off-by: Dan Ryan <dan@danryan.co>

Update linux tests

Signed-off-by: Dan Ryan <dan@danryan.co>

Make sure home directory exists

Signed-off-by: Dan Ryan <dan@danryan.co>

Use pipenv to run tests

Signed-off-by: Dan Ryan <dan@danryan.co>

add vendoring script to linux build scripts

Signed-off-by: Dan Ryan <dan@danryan.co>

fix vendoring test

Signed-off-by: Dan Ryan <dan@danryan.co>

Lets try it this way

Signed-off-by: Dan Ryan <dan@danryan.co>

Syntax issue

Signed-off-by: Dan Ryan <dan@danryan.co>

Prune vsts-ci folder from manifest

Signed-off-by: Dan Ryan <dan@danryan.co>

Separate manifest step from vendoring

Signed-off-by: Dan Ryan <dan@danryan.co>

Update vsts vendoring script

Signed-off-by: Dan Ryan <dan@danryan.co>

Syntax error..

Signed-off-by: Dan Ryan <dan@danryan.co>

fix vendoring

Signed-off-by: Dan Ryan <dan@danryan.co>

gah wrong version spec!

Signed-off-by: Dan Ryan <dan@danryan.co>

fix vsts

Signed-off-by: Dan Ryan <dan@danryan.co>

test updates

Signed-off-by: Dan Ryan <dan@danryan.co>

VSTS Syntax error...

Signed-off-by: Dan Ryan <dan@danryan.co>

and fix windows runner

Signed-off-by: Dan Ryan <dan@danryan.co>

maybe...

Signed-off-by: Dan Ryan <dan@danryan.co>

does this one work?

Signed-off-by: Dan Ryan <dan@danryan.co>

how about now

Signed-off-by: Dan Ryan <dan@danryan.co>

fix manifest

Signed-off-by: Dan Ryan <dan@danryan.co>

hmm now windows fails?

Signed-off-by: Dan Ryan <dan@danryan.co>

hmmmm...

Signed-off-by: Dan Ryan <dan@danryan.co>

Conditonal testing uses its own special phase

Signed-off-by: Dan Ryan <dan@danryan.co>
  • Loading branch information
techalchemy committed Aug 29, 2018
1 parent 30cbfcf commit a6fb4a7
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 42 deletions.
8 changes: 8 additions & 0 deletions .vsts-ci/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
phases:
- template: phases/test.yml
parameters:
queue: Hosted Linux Preview

- template: phases/run-vendor-scripts.yml
parameters:
queue: Hosted Linux Preview
14 changes: 14 additions & 0 deletions .vsts-ci/phases/run-manifest-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- bash: |
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install check-manifest
check-manifest
37 changes: 37 additions & 0 deletions .vsts-ci/phases/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- bash: |
mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs"
mkdir -p "$WORKON_HOME"
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
export PIP_PROCESS_DEPENDENCY_LINKS="1"
echo "Path: $PATH"
echo "Installing Pipenv…"
pip install -e "$(pwd)" --upgrade
pipenv install --deploy --dev
echo pipenv --venv && echo pipenv --py && echo pipenv run python --version
displayName: Make Virtualenv

- script: |
# Fix Git SSL errors
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
export PIP_PROCESS_DEPENDENCY_LINKS="1"
pipenv run pytest --junitxml=test-results.xml
displayName: Run integration tests

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
39 changes: 39 additions & 0 deletions .vsts-ci/phases/run-vendor-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
queue:

phases:
- phase: Vendor_Scripts
displayName: Test Vendor Scripts

queue:
name: ${{ parameters.queue }}
parallel: 4
matrix:
${{ if eq(parameters.queue, 'Hosted VS2017') }}:
# TODO remove once Hosted VS2017 has Python 3.7
Python37:
python.version: '>= 3.7.0-b2'
python.architecture: x64
${{ if ne(parameters.queue, 'Hosted VS2017' )}}:
Python37:
python.version: '>= 3.7'
python.architecture: x64
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- bash: |
mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs"
mkdir -p "$WORKON_HOME"
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install --upgrade invoke requests parver
python -m invoke vendoring.update
- template: ./run-manifest-check.yml
49 changes: 15 additions & 34 deletions .vsts-ci/phases/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ phases:

queue:
name: ${{ parameters.queue }}
parallel: 2
parallel: 4
matrix:
Python27:
python.version: '2.7'
Expand All @@ -17,52 +17,33 @@ phases:
Python37:
python.version: '>= 3.7.0-b2'
python.architecture: x64

${{ if ne(parameters.queue, 'Hosted VS2017' )}}:
Python37:
python.version: '>= 3.7'
python.architecture: x64
steps:
- ${{ if eq(parameters.queue, 'Hosted VS2017') }}:
- template: ../steps/run-tests-windows.yml
- template: ./run-tests-windows.yml

# - ${{ if ne(parameters.queue, 'Hosted VS2017') }}:
# - template: ../steps/run-tests.yml
- ${{ if ne(parameters.queue, 'Hosted VS2017') }}:
- template: ./run-tests.yml

- phase: Test_Secondary
displayName: Test Secondary
displayName: Test python3.6
# Run after Test_Primary so we don't devour time and jobs if tests are going to fail
dependsOn: Test_Primary
# dependsOn: Test_Primary

queue:
name: ${{ parameters.queue }}
parallel: 5
parallel: 4
matrix:
Python34:
python.version: '3.4'
python.architecture: x64
Python35:
python.version: '3.5'
python.architecture: x64
# TODO remove `if` once Hosted VS2017 has Python 3.7
# ${{ if ne(parameters.queue, 'Hosted VS2017') }}:
# Python37:
# python.version: '3.7'
# python.architecture: x64
# On Windows, test x86 builds
Python36:
python.version: '3.6'
python.architecture: x64
Python27-x86:
python.version: '2.7'
python.architecture: x86
Python36-x86:
python.version: '3.6'
python.architecture: x86
# TODO change to 3.7 once Hosted VS2017 has Python 3.7
Python37-x86:
python.version: '>= 3.7.0-b2'
python.architecture: x86

steps:
- ${{ if eq(parameters.queue, 'Hosted VS2017') }}:
- template: ../steps/run-tests-windows.yml
- template: ./run-tests-windows.yml

- ${{ if ne(parameters.queue, 'Hosted VS2017') }}:
- template: ./run-tests.yml

# - ${{ if ne(parameters.queue, 'Hosted VS2017') }}:
# - template: ../steps/run-tests.yml
4 changes: 2 additions & 2 deletions .vsts-ci/steps/create-virtualenv.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- script: |
virtualenv D:\.venv
D:\.venv\Scripts\activate.bat && D:\.venv\Scripts\pip.exe install -e . && D:\.venv\Scripts\pipenv install --dev
D:\.venv\Scripts\activate.bat && echo D:\.venv\Scripts\pipenv --venv && echo D:\.venv\Scripts\pipenv --py && echo D:\.venv\Scripts\pipenv run python --version
D:\.venv\Scripts\pip.exe install -e . && D:\.venv\Scripts\pipenv install --dev
echo D:\.venv\Scripts\pipenv --venv && echo D:\.venv\Scripts\pipenv --py && echo D:\.venv\Scripts\pipenv run python --version
displayName: Make Virtualenv
8 changes: 4 additions & 4 deletions .vsts-ci/steps/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
steps:
- powershell: |
# Fix Git SSL errors
pip install certifi tox
pip install certifi
python -m certifi > cacert.txt
$env:GIT_SSL_CAINFO = $(Get-Content cacert.txt)
# Shorten paths to get under MAX_PATH or else integration tests will fail
# https://bugs.python.org/issue18199
subst T: $env:TEMP
$env:TEMP = "T:\"
$env:TMP = "T:\"
D:\.venv\Scripts\activate.ps1 && D:\.venv\Scripts\pipenv run pytest -n 4 --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
displayName: Tox run integration tests
D:\.venv\Scripts\pipenv run pytest -n 4 --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
displayName: Run integration tests

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: junit/*.xml
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
9 changes: 7 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
include LICENSE README.md CONTRIBUTING.md CODE_OF_CONDUCT.md CHANGELOG.rst NOTICES HISTORY.txt
include Makefile pyproject.toml get-pipenv.py examples
include Makefile pyproject.toml get-pipenv.py
include examples/Pipfil*
recursive-include pipenv LICENSE LICENSE* *LICENSE* *COPYING* t32.exe t64.exe w32.exe w64.exe cacert.pem
recursive-include pipenv *.cfg
recursive-include pipenv/vendor *.c *.j2
recursive-include pipenv *.md
recursive-include pipenv *.md *.APACHE *.BSD
recursive-include pipenv Makefile
recursive-include pipenv/vendor vendor.txt
recursive-include pipenv README
include pipenv/patched/notpip/_vendor/vendor.txt
include pipenv/patched/safety.zip pipenv/patched/patched.txt
include pipenv/vendor/pipreqs/stdlib pipenv/vendor/pipreqs/mapping
Expand All @@ -22,6 +26,7 @@ recursive-exclude docs requirements*.txt

prune .buildkite
prune .github
prune .vsts-ci
prune docs/build
prune news
prune tasks
Expand Down
2 changes: 2 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ if [[ ! -z "$HOME" ]]; then
export PATH="${HOME}/.local/bin:${PATH}"
fi
# pip uninstall -y pipenv
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
echo "Path: $PATH"
echo "Installing Pipenv…"
PIP_USER="1" python -m pip install --upgrade setuptools
Expand Down

0 comments on commit a6fb4a7

Please sign in to comment.