* Add randomized testing stage to travis.
* Update report_ci_failure to create an issue for failed random tests.
* Remove randomized tests from unit test and coverage.
* Add hypothesis example database to travis cache.
* Make test running concurrency dynamic based on nprocs
In #1228 we decreased the concurrency used for the test runner in CI to
avoid memory pressure and failing jobs. In that commit we set it to 2 as
a quick fix so we could unblock CI and continue landing patches. A
followup was to do the analysis and find the sweet spot for concurrency
and stability. At the same time we opened mtreinish/stestr#202 to add
support to the test runner for running fractional nprocs. That is still
under discussion, but in the meantime this commit adds support to the
makefile for using fractional nprocs concurrency. It adjusts are default
concurrency from 2 to be nprocs / 2 if nprocs > 3. This should enable us
to increase the number of test workers we run on travis linux jobs but
still maintain reliability.
* Hard code osx to 2 workers
* Add debug statement about core count and worker count
* Use printf to round floats to int
* Add test_ci make target, revert make test
Add a new "test_ci" target to the Makefile, aimed at being used by
the CIs. Update the "test" family of targets in order to revert
back to the behaviour that involves less overhead and complexity
for the users.
* Update travis in order to use test_ci
* Add documentation about test_ci target
* Remove legacy cpp code
* remove legacy cpp sim from make and travis
* Rename decorator and folder for aer provider tests
* remove Cpp simulator for setup.py
* fixup
* Remove all cmake and cleanup travis config
Since we're no longer building any C++ code there is no need to keep
cmake usage around anymore. This commit removes the last cmake remnants
and also cleans up the travis config to simply run make && make test to
install everything and then just invoke the test runner. It also
deduplicates jobs now that there is no distinction between no_compile
and compile jobs.
* Fix some small oversights
* Remove legacysimulator contributing doc section
* Cleaning up documentation
* Small updates
* Adding changes
* headings
* Heading
* More changes
* Small changes
* Additions
* Adding the Qiskit notebooks
* some typos
* Update to ibm
* Small updates
* replace logo for terra logo
* Replace parsed-literal with code-block
Replace blocks of command output with `..: code-block: text`, adjusting
the style to avoid syntax highlighting, copy-paste widget, and colored
background.
* Recover testing flags information into CONTRIB (#4)
* Slack link
Since enabling parallel test execution we're seeing a couple new issues
including failures caused by memory allocation issues in travis. This is
likely caused by increased memory pressue from running with nproc
workers, which on travis for linux means 32 workers. To decrease our
memory usage in CI and to also decrease the chances of a cross
interaction between tests running at the same time this commit changes
the test runner concurrency in travis runs to two workers instead of
nproc workers. Two workers is the least common demoniator between all
the travis environments (osx nodes only having 2 cpus), and since we
are using a fixed value that is used.
* 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.
* Fix Sphinx warnings and errors
Fix warnings related to `make doc`:
* Fix docstrings with invalid format, and small changelog issue.
* Remove jupyter functionality from autodoc due to failing imports.
* Fix wrong headings separators introduced by #697.
* Update release notes
Add introductory text and section about `QuantumProgram`, along with
placeholders for other entries.
Update backend and job sections for fixing links to classes and small
tunings overall.
* Add credentials section to release notes
* Fix reference and literal block
* updating 0.6 release notes
* more stuff for release notes
* Minor sphinx fixes (warnings, syntax)
* polish a bit
* Update releases.rst
Calling `job.status()` since it is a method, not a property.
* final small change
The current commit introduces several changes to the testing infrastructure.
First, it provides a way of running IBM-Q tests against pre-recorded responses. The software in charge of recording and mocking-up the responses is VCRPy[1] and it is configured and used in `test/common.py`. Cassettes can be updated by using `make test_recording`.
[1] https://github.com/kevin1024/vcrpy
The commit also includes the latest responses (under `tests/casettes`) for a successful test run but a default execution with `make test` will only use them if no IBM-Q credentials are found. To force a run against mocked responses, use `make test_mock`.
Finally, the commit also unifies the several test options in a unique environmental variable called `QISKIT_TESTS` (in `tests/python/_test_options.py`). These are the main equivalences but the set of options is described in the developer introduction [2]:
- `SKIP_SLOW_TESTS=False` is now achieved by `QISKIT_TESTS=run_slow`
- `SKIP_ONLINE_TESTS=1` is now achieved by `QISKIT_TESTS=skip_online`
[2] https://github.com/Qiskit/qiskit-terra/blob/master/doc/dev_introduction.rst#testing-options
Update the tooling used for the automatic documentation of the package
for using the latest versions of the packages involved, updating the
templates in the process.
Includes some cosmetical changes, and also fixes the issue of producing
files with the same name but with different capitalization that resulted
in issues in case-insensitive filesystems (ahem); by rendering the
private modules too (although orphaned) so the classes and members are
documented in those files.
* creating conf.py for German language
* initial German translation
* minor fixes and typos
* fixing typos and cleaning
* adding DE version
* fixing formatting issues
* fixing formatting issues
* formatting issues
* first DE version of index.rst
* fixing typos
* adding German translation de
* adding German translation
* adding German intro translation
* fixing minor typo
* adding German translation of real backend example
* minor typo
* adding German translation of getting started
* adding German translation of dev_introduction.rst
* fixing minor typos and beautification
* fixing title underline
* fixing image ref
* fixing broken links
* fixing broken reference
* fixing formatting issue
* add line in changelog
* remove note on downgrade requirements according to main doc
* Update CHANGELOG.rst
* minor fixes
* new dependencies target (make depend) for the qasm-simulator-cpp
(cherry picked from commit 3b253908a69101f14d37dac5ece4b51f0c9b80ec)
* changed to executable and bug fix
(cherry picked from commit ce8be89dac7fc0a40e39f0dbbf67cf32c072a4d0)
* assume yes for automatic pkg install
(cherry picked from commit 2cd7607db606753ae0aafa0b2fb8ffea30732dae)
* -march not supported on ppc64le. Use -mcpu instead
(cherry picked from commit 7cdab8ff632f2348d19b83b43781bf97f89c642b)
* bugfix
(cherry picked from commit 831692e34a89597e9c85706ab3e048d32e94f1f3)
* coverage rule in Makefile
* coverage in cmake
* clean coverage rule
* it looks like there is a proper way to remove the coverage data
* cmake: coverage_erase
* Add coverage target to cmake, fix typo
* Fix travis osx brew python (now upgrade)
Convert `qiskit.tools` to real Python modules by adding __init__.py,
adding lint and style fixes in the process.
Enable style and lint Travis check for qiskit.tools.
Minor fixes for the tests:
* use subtests in several places, for easier identification of the
failing assertions in loops.
* style, variable names, and typo fixes.
* add cleanup of the files generated by the tests to the `make clean`
target.
Fix the failing tests for the C++ simulator via:
* relaxing test_local_qiskit_simulator, just comparing that the keys
of get_counts match the expected ones instead of comparing the values
as well, due to an issue with randomness.
* start the unittest discovery on the "test/" directory, instead of the
root directory, as otherwise the QuantumCircuit header will be
modified by the time the C++ gate files are read (and the tests that
compare the lenghts of the QASMs will fail due to the extra
definitions).
Make the `executable` a class configuration key for the C++ simulator
instead of a qobj key, allowing the auto-discovery mechanism to pick
the two classes automatically if the executable is present. Two
locations are attempted by default (one is the standard one when using
the repository, the other one when using pip), which can be overriden
in the `configuration['exe']` parameter of the constructor if needed.
Style, linting and whitespace fixes.
* Changed default path of the simulator to:
1st - The path where the simulator is built by default from the
Makefile
2nd - The path where pip installs simulator binary
* Removed .gitignore entries that are not needed anymore
* Integrate simulator's make clean target into the main Makefile
* Relax the pylint output disabling several warnings.
* Reintroduce the linting of qiskit.extensions and qiskit.qasm.node.
* Add a `style` target to the Makefile that performs pycodestyle, and
reduce the verbosity of `lint` by removing the report.
* Update the Travis configuration in order to add a new step that
performs linter and style checks via an environment variable.
* Added japanese doc
* Update Make and structure to allow multiple langs
Update the Makefile "doc" target to build both the English and the
Japanese versions, in separate directories, and the "clean" target to
cleanup the autodoc documentation.
Add a "conf.py" file to the "doc/ja" folder that modifies the relevant
variables, as Sphinx uses that folder as the root document folder when
building the Japanese version.
* Fix missing "install" reference on ja sphinx docs
* Update sphinx doc deploy script for Japanese
Add the Japanese sphinx produced directory to the Github pages deploy
script.
* Fix typo and extra line in Makefile
* Add runtime check for IBMQuantumExperience version
Add `qiskit._util._check_ibmqe_version()` (invoked on the main import)
for emitting a warning if the installed version of IBMQuantumExperience
does not match the version defined on `setup.py`.
* Rename requires.txt and requires-dev.txt
Rename to "requirements.txt" and "requirements-dev.txt", in order to
conform better to the de-facto practices.
Update the requirements to match the versions specified in setup.py.
* setup.py: OS classifiers, backend, IBMQE version
* Explicitly require IBMQuantumExperience>=1.8.13, as older versions
might not contain all the functionality needed.
* Include "qiskit.backends" as a package instead of "qiskit.simulators".
* Add trove classifiers for the operative systems supported.
* Fix PEP8 warnings for long description.
* Avoid using __version__ in setup.py due to imports
Revert the change of using "__version__" imported from "__init__.py"
directly on "setup.py", as the current importing of the modules from
"__init__.py" causes the building to fail due to the dependencies not
being available at the time of invocation.
Make the default linter configuration less strict, reducing the number
of false positives and the usefulness of the existing output with a
combination of:
* ignoring specific files entirely (such as the parser or the standard
extension individual files)
* ignore specific warnings on some files (such as "invalid-name" on
files that use variables mapped to mathematic algorithms)
* disable specific tags globaly (in particular, "no-self-use")
Also make the linter more strict when it comes to docstrings via the
"pylint.extensions.docparams" plugin.
Fix duplicated entries on the Table of Contents caused by the
qiskit.extensions.standard module importing symbols with the same name
as the submodules by unifying the output of the better-apidoc template.
Revert to using "doc/_autodoc" as the single output folder for the .rst.
Reorganize the summary generated for the modules, splitting the members
into several sections. Revise the generation of the TOC so links to the
stubs and the public docs are included on the sidebar.
Replace the full apidoc automatically generated documentation with a
set of pages that display only the public objects (using the class path
specified by the main import: ie "qiskit.QuantumProgram" instead of
"qistkit._quantumprogram.QuantumProgram") via custom templates using the
better-apidoc package.
This addresses an issue with installation of setuptools during initial 'make env'.
'make env' also tries to deal more gracefully with previous run of the target.
* get list of circuit names in program
* Enable len(circuit), circuit[n], and len(register).
This allows circuits and registers to behave more like lists.
len(circuit): number of instructions in circuit
circuit[n]: nth instruction added to circuit
len(register): size of register
* Add profiling facility. Test for QasmSimulator.
Makefile modified to allow profiling with python's unittest
discovery facility. Test files are in same directory as the module
they test. Make targets changed so that
make test: looks for tests matching "test*.py" and "*_test.py".
make profile: looks for unittest profiling matching "*_profile.py"
To avoid file pollution discovery matching "*_profile.py" pattern
gets routed to test module by generating a profiling suite of tests.
This is done with unittest's "load_tests" facility.
* Fix test to work with jsonbackend.
Also, fixed warnings during test about unclosed file in lexer.