qiskit/tox.ini

34 lines
689 B
INI
Raw Normal View History

[tox]
minversion = 2.1
envlist = py35, py36, py37, lint
skipsdist = True
[testenv]
usedevelop = True
basepython = python3
install_command = pip install -c{toxinidir}/constraints.txt -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
ARGS="-V"
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
commands =
Switch to stestr for test runner (#737) * Switch to stestr for test runner This commit switches the default test runner for qiskit-terra to use stestr instead of the built-in runner from stdlib unittest. By default this switches the default mode of execution to be parallel instead of serial which can lead to significant speed ups in test execution time. Also the junitxml upload on the appveyor ci is switched to use the subunit protocol instead of the xunit format. This is because subunit is used natively by stestr. While we can generate xunit xml in the same exact format it doesn't work on windows because of the subunit library bug: https://bugs.launchpad.net/subunit/+bug/1322888 . Once this bug is fixed we can convert the subunit to xunit xml as part of the CI job. That being said though, the subunit data contains every thing and whatever post processing is being done on the xml files can easily be converted to use the subunit. Closes #730 * Remove initial check for initializing state The initializing state for a job is a transient condition. Depending on how fast the test executes we may or may not be able to catch it during the execution of the test. When running the test suite in parallel we're seeing many instances where things execute too quickly and the assert looking for the initial initializing state is too slow and the api status has already moved on. This commit fixes this by simply removing that check from all the tests since it can't be reliably checked. * Stop writing progress bar to stdout during tests This commit adjust the parallel_progress bar unit tests to mock out sys.stdout.write() so we aren't actually writing the progress bar to stdout during the test run. We're not actually verifying the contents written to stdout anywhere in the tests and this both pollutes stdout during a run and also fails when running tests under stestr on windows ci, likely because of how python-subunit (a external dependency library of stestr's) internally handles stdout encapsulation. So to avoid these this commit mocks out the stdout writes and asserts we're at least calling it. In the future we can adjust these to actually verify the calls for the proper output. But for right now asserting we're even calling sys.stdout.write() is an improvement and avoids the issues. * Fix typos in tox.ini * Change to per test method parallelization by default Prior to this commit we were using test class level parallelization (ie each test class is the minimum unit that gets passed to a worker). This was done to optimize for the online tests which have expensive class level constructors which we wouldn't want to run multiple times if the individual test methods got split across multiple workers. However, this was hurting the overall performance of the more common case where we don't make actual api requests. This commit switches us to use per method parallelization by default and manually switch to per class for the online tests in CI. * Revert "Change to per test method parallelization by default" This reverts commit 0ab794b0a5bc14d23e1820042a70f66b0d68c99b. * Update appveyor comments for using test_results.xml This commit updates the comments in the appveyor to refer to the upstream fix needed to leverage the test_results.xml. It also adds all the necessary lines to properly generate an xunit xml file and upload it.
2018-11-07 01:43:03 +08:00
stestr run {posargs}
[testenv:lint]
commands =
pycodestyle --max-line-length=100 qiskit test
pylint -rn qiskit test
Add reno release notes for 0.9 release (#2919) * Add reno release notes for 0.9 release This commit starts the process of adding release notes using reno to qiskit-terra. This notes for several of the user facing changes in the 0.9 release so far. We can continue to modify release notes after the fact because they're tied to the git history for which release they're associated with. New release notes can be added with: "reno new $name" and you can generate rst output using "reno report" Moving forward the expectation is that we'll require a PR to include release documentation in the form of a reno release note before we merge it, if it contains a user facing change. Release notes differ from changelog in that they provide much more detail to end users on what has changed, how they can adapt to it, and why it was changed (if necessary). Accordingly the release notes are free form restructured text that enables writing as much as needed. While the changelog is just a record of a change that has potential end user impact and normally doesn't provide the detail needed by users. Honestly the changelog creation shouldn't be a manual process it should be automatically generated using a combination of git and commit msg metadata. Fixes #2230 * Add more release notes * Add more release notes for new features * Add more release notes * Add more upgrade notes * Add reno lint check to CI * Add more notes * Add release notes for changes that were missing a changelog entry * Expand incomplete notes * Fix whitespace * Add documentation on release notes to CONTRIBUTING.md * Add qsphere update release notes * Update diagGate() name to diag_gate() * Add release notes for pulse samplers * Add release notes for layout in circuit drawers * Add upgrade note about new warnings * Replace stray hardtab with spaces * Add release note on line magic api change * Apply suggestions from code review Co-Authored-By: Luciano <luciano.bello@ibm.com> * Update CONTRIBUTING.md Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> * Fix typo
2019-08-20 02:12:55 +08:00
reno lint
[testenv:coverage]
Switch to stestr for test runner (#737) * Switch to stestr for test runner This commit switches the default test runner for qiskit-terra to use stestr instead of the built-in runner from stdlib unittest. By default this switches the default mode of execution to be parallel instead of serial which can lead to significant speed ups in test execution time. Also the junitxml upload on the appveyor ci is switched to use the subunit protocol instead of the xunit format. This is because subunit is used natively by stestr. While we can generate xunit xml in the same exact format it doesn't work on windows because of the subunit library bug: https://bugs.launchpad.net/subunit/+bug/1322888 . Once this bug is fixed we can convert the subunit to xunit xml as part of the CI job. That being said though, the subunit data contains every thing and whatever post processing is being done on the xml files can easily be converted to use the subunit. Closes #730 * Remove initial check for initializing state The initializing state for a job is a transient condition. Depending on how fast the test executes we may or may not be able to catch it during the execution of the test. When running the test suite in parallel we're seeing many instances where things execute too quickly and the assert looking for the initial initializing state is too slow and the api status has already moved on. This commit fixes this by simply removing that check from all the tests since it can't be reliably checked. * Stop writing progress bar to stdout during tests This commit adjust the parallel_progress bar unit tests to mock out sys.stdout.write() so we aren't actually writing the progress bar to stdout during the test run. We're not actually verifying the contents written to stdout anywhere in the tests and this both pollutes stdout during a run and also fails when running tests under stestr on windows ci, likely because of how python-subunit (a external dependency library of stestr's) internally handles stdout encapsulation. So to avoid these this commit mocks out the stdout writes and asserts we're at least calling it. In the future we can adjust these to actually verify the calls for the proper output. But for right now asserting we're even calling sys.stdout.write() is an improvement and avoids the issues. * Fix typos in tox.ini * Change to per test method parallelization by default Prior to this commit we were using test class level parallelization (ie each test class is the minimum unit that gets passed to a worker). This was done to optimize for the online tests which have expensive class level constructors which we wouldn't want to run multiple times if the individual test methods got split across multiple workers. However, this was hurting the overall performance of the more common case where we don't make actual api requests. This commit switches us to use per method parallelization by default and manually switch to per class for the online tests in CI. * Revert "Change to per test method parallelization by default" This reverts commit 0ab794b0a5bc14d23e1820042a70f66b0d68c99b. * Update appveyor comments for using test_results.xml This commit updates the comments in the appveyor to refer to the upstream fix needed to leverage the test_results.xml. It also adds all the necessary lines to properly generate an xunit xml file and upload it.
2018-11-07 01:43:03 +08:00
setenv =
{[testenv]setenv}
PYTHON=coverage3 run --source qiskit --parallel-mode
commands =
Switch to stestr for test runner (#737) * Switch to stestr for test runner This commit switches the default test runner for qiskit-terra to use stestr instead of the built-in runner from stdlib unittest. By default this switches the default mode of execution to be parallel instead of serial which can lead to significant speed ups in test execution time. Also the junitxml upload on the appveyor ci is switched to use the subunit protocol instead of the xunit format. This is because subunit is used natively by stestr. While we can generate xunit xml in the same exact format it doesn't work on windows because of the subunit library bug: https://bugs.launchpad.net/subunit/+bug/1322888 . Once this bug is fixed we can convert the subunit to xunit xml as part of the CI job. That being said though, the subunit data contains every thing and whatever post processing is being done on the xml files can easily be converted to use the subunit. Closes #730 * Remove initial check for initializing state The initializing state for a job is a transient condition. Depending on how fast the test executes we may or may not be able to catch it during the execution of the test. When running the test suite in parallel we're seeing many instances where things execute too quickly and the assert looking for the initial initializing state is too slow and the api status has already moved on. This commit fixes this by simply removing that check from all the tests since it can't be reliably checked. * Stop writing progress bar to stdout during tests This commit adjust the parallel_progress bar unit tests to mock out sys.stdout.write() so we aren't actually writing the progress bar to stdout during the test run. We're not actually verifying the contents written to stdout anywhere in the tests and this both pollutes stdout during a run and also fails when running tests under stestr on windows ci, likely because of how python-subunit (a external dependency library of stestr's) internally handles stdout encapsulation. So to avoid these this commit mocks out the stdout writes and asserts we're at least calling it. In the future we can adjust these to actually verify the calls for the proper output. But for right now asserting we're even calling sys.stdout.write() is an improvement and avoids the issues. * Fix typos in tox.ini * Change to per test method parallelization by default Prior to this commit we were using test class level parallelization (ie each test class is the minimum unit that gets passed to a worker). This was done to optimize for the online tests which have expensive class level constructors which we wouldn't want to run multiple times if the individual test methods got split across multiple workers. However, this was hurting the overall performance of the more common case where we don't make actual api requests. This commit switches us to use per method parallelization by default and manually switch to per class for the online tests in CI. * Revert "Change to per test method parallelization by default" This reverts commit 0ab794b0a5bc14d23e1820042a70f66b0d68c99b. * Update appveyor comments for using test_results.xml This commit updates the comments in the appveyor to refer to the upstream fix needed to leverage the test_results.xml. It also adds all the necessary lines to properly generate an xunit xml file and upload it.
2018-11-07 01:43:03 +08:00
stestr run {posargs}
coverage3 combine
coverage3 report