Merge pull request #750 from datastax/appveyor_test_improve

Appveyor test improve
This commit is contained in:
Jaume Marhuenda 2017-06-26 17:51:31 -04:00 committed by GitHub
commit 54c5e982eb
5 changed files with 51 additions and 14 deletions

View File

@ -1,10 +1,10 @@
environment:
matrix:
- PYTHON: "C:\\Python27-x64"
cassandra_version: 3.0.5
cassandra_version: 3.10
ci_type: standard
- PYTHON: "C:\\Python34"
cassandra_version: 3.0.5
cassandra_version: 3.10
ci_type: unit
os: Visual Studio 2015
platform:

View File

@ -2,6 +2,8 @@ $env:JAVA_HOME="C:\Program Files\Java\jdk1.8.0"
$env:PATH="$($env:JAVA_HOME)\bin;$($env:PATH)"
$env:CCM_PATH="C:\Users\appveyor\ccm"
$env:CASSANDRA_VERSION=$env:cassandra_version
$env:EVENT_LOOP_MANAGER="async"
python --version
python -c "import platform; print(platform.architecture())"
# Install Ant
@ -57,9 +59,13 @@ $env:PYTHONPATH="$($env:CCM_PATH);$($env:PYTHONPATH)"
$env:PATH="$($env:CCM_PATH);$($env:PATH)"
# Predownload cassandra version for CCM if it isn't already downloaded.
# This is necessary because otherwise ccm fails
If (!(Test-Path C:\Users\appveyor\.ccm\repository\$env:cassandra_version)) {
Start-Process python -ArgumentList "$($env:CCM_PATH)\ccm.py create -v $($env:cassandra_version) -n 1 predownload" -Wait -NoNewWindow
echo "Checking status of download"
python $env:CCM_PATH\ccm.py status
Start-Process python -ArgumentList "$($env:CCM_PATH)\ccm.py remove predownload" -Wait -NoNewWindow
echo "Downloaded version $env:cassandra_version"
}
Start-Process python -ArgumentList "-m pip install -r test-requirements.txt" -Wait -NoNewWindow

View File

@ -3,22 +3,49 @@ Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -force
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser -force
Get-ExecutionPolicy -List
echo $env:Path
echo $env:JAVA_HOME
echo $env:PYTHONPATH
echo $env:CASSANDRA_VERSION
echo "JAVA_HOME: $env:JAVA_HOME"
echo "PYTHONPATH: $env:PYTHONPATH"
echo "Cassandra version: $env:CASSANDRA_VERSION"
echo $env:ci_type
python --version
python -c "import platform; print(platform.architecture())"
$wc = New-Object 'System.Net.WebClient'
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=unit_results.xml .\tests\unit
$env:MONKEY_PATCH_LOOP=1
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=unit_results.xml .\tests\unit\io\test_geventreactor.py
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=unit_results.xml .\tests\unit\io\test_eventletreactor.py
Remove-Item $env:MONKEY_PATCH_LOOP
if($env:ci_type -eq 'unit'){
echo "Running Unit tests"
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=unit_results.xml .\tests\unit
echo "uploading unit results"
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\unit_results.xml))
$env:MONKEY_PATCH_LOOP=1
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=unit_results.xml .\tests\unit\io\test_geventreactor.py
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=unit_results.xml .\tests\unit\io\test_eventletreactor.py
Remove-Item $env:MONKEY_PATCH_LOOP
exit 0
echo "uploading unit results"
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\unit_results.xml))
}
if($env:ci_type -eq 'standard'){
echo "Running CQLEngine integration tests"
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=cqlengine_results.xml .\tests\integration\cqlengine
$cqlengine_tests_result = $lastexitcode
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\cqlengine_results.xml))
echo "uploading CQLEngine test results"
echo "Running standard integration tests"
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=standard_results.xml .\tests\integration\standard
$integration_tests_result = $lastexitcode
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\standard_results.xml))
echo "uploading standard integration test results"
}
if($env:ci_type -eq 'long'){
nosetests -s -v --with-ignore-docstrings --with-xunit --xunit-file=cqlengine_results.xml .\tests\integration\cqlengine
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\cqlengine_results.xml))
echo "uploading standard integration test results"
}
$exit_result = $unit_tests_result + $cqlengine_tests_result + $integration_tests_result
echo "Exit result: $exit_result"
exit $exit_result

View File

@ -31,6 +31,7 @@ elif "async" in EVENT_LOOP_MANAGER:
elif "twisted" in EVENT_LOOP_MANAGER:
from cassandra.io.twistedreactor import TwistedConnection
connection_class = TwistedConnection
else:
from cassandra.io.libevreactor import LibevConnection
connection_class = LibevConnection

View File

@ -32,7 +32,7 @@ from cassandra.connection import Connection
from cassandra.policies import WhiteListRoundRobinPolicy, HostStateListener
from cassandra.pool import HostConnectionPool
from tests import is_monkey_patched
from tests import is_monkey_patched, notwindows
from tests.integration import use_singledc, PROTOCOL_VERSION, get_node, CASSANDRA_IP, local
try:
@ -360,6 +360,9 @@ class ConnectionTests(object):
for t in threads:
t.join()
# We skip this one for windows because the clock is not as
# granular as in linux
@notwindows
def test_connect_timeout(self):
# Underlying socket implementations don't always throw a socket timeout even with min float
# This can be timing sensitive, added retry to ensure failure occurs if it can