Commit Graph

73 Commits

Author SHA1 Message Date
Kevin Krsulich 60c8bba11f Add randomized testing stage to travis (#2620)
* 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.
2019-06-17 10:36:20 -04:00
Luciano aa67ab87ba
Remove VCR (#2448) 2019-06-02 12:06:24 -04:00
Diego M. Rodríguez 3b394f8f0b Revert pylint execution to non-parallel behaviour (#2403) 2019-05-13 10:04:50 -04:00
Lev Bishop 7f0ad7ff30 Remove profile testing loader (#2368) 2019-05-09 10:45:40 +02:00
Paul Nation 97cf677137
Copyrights (#2249)
* 2017 cps

* 2018 cps

* 2019 cps
2019-04-30 10:36:47 -04:00
Luciano f36942d438 parallel pylint execution (#2211)
* parallel lint execution

* ignored-classes=QuantumCircuit

* clean up pylint: disable=no-member
2019-04-26 18:37:21 -04:00
Matthew Treinish 7a9cd63702 Make test running concurrency dynamic based on nprocs (#1973)
* 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
2019-04-05 14:17:50 -04:00
Diego M. Rodríguez 347c8d9fc1 Remove "make doc" target (#1756)
* Remove "make doc" target

* Empty make clean target
2019-02-07 13:29:37 -05:00
Diego M. Rodríguez 8882982585 Add "make test_ci" target for CIs, simplify "make test" (#1745)
* 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
2019-02-05 16:28:16 -05:00
Joe Latone abe8362022 Issue #1691: Fixed a minor conda env bug in Makefile (#1693)
* Issue #000: ignore case when testing  conda env exists

* Fixed a minor conda env bug in Makefile (#1691).
2019-01-21 13:03:51 +01:00
Christopher J. Wood 4bf0db919f Remove legacy C++ simulator code (#1644)
* 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
2019-01-08 17:22:18 -05:00
Diego M. Rodríguez d03e50eeaf Sphinx docstring cleanup, and include qiskit.tools (#1543)
* Docstrings fixes for removing Sphinx warnings

* Fix splitting of TOC entries

* Include qiskit/tools in sphinx documentation
2018-12-18 15:36:33 -05:00
Jay Gambetta 8fe6af5d58 Documenation changes (#1254)
* 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
2018-11-13 23:50:58 -05:00
Matthew Treinish 21f2730069
Decrease test runner concurrency on travis (#1228)
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.
2018-11-08 10:57:40 -05:00
Matthew Treinish 6eb436e411 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-06 17:43:03 +00:00
Diego M. Rodríguez 17fda19325 0.6 release notes (#867)
* 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
2018-09-11 11:45:32 -04:00
Luciano 97d24d1130 Save network interactions to allow tests to run offline by providing mocked responses (#697)
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
2018-08-20 20:42:23 +02:00
Diego M. Rodriguez 3f15def726 Update sphinx autodoc: bump version, template
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.
2018-07-17 13:30:43 +02:00
alfrisch d2683cb743 Adding german translation of doc files (#592)
* 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
2018-06-28 18:22:36 -04:00
Abdón Rodríguez Davila 6bbc764534 Consistent license across all the project (#550)
* Consistent license across all the project

* Update license

* Update LICENSE.txt

* Update licenses

* Fix linter
2018-06-08 15:00:58 +02:00
sathayen 6161c8adad Simulator dependency target, fix for Power architecture (#5)
* 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)
2018-04-13 16:16:14 -04:00
cjwood b9e7aad2c2 renamed qiskit-simulator folder to qasm-simulator-cpp
cmake build needs updating for new directory / exe file name
2018-04-13 16:13:57 -04:00
cjwood 16486e1bbc Updated makefile to install to qiskit/backends, fix error in JSON deserialisation of clifford snapshots 2018-04-13 16:13:56 -04:00
Luciano de1f66a94b Coverage of the testsuite (#297)
* 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)
2018-03-05 20:38:13 +01:00
Diego M. Rodríguez 536ac4d462
Convert qiskit.tools to modules, lint (#275)
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.
2018-02-05 11:47:53 +01:00
Diego M. Rodriguez 8bd7b8c41a Test fixes: subtests, names, make clean
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.
2018-01-16 20:44:47 +01:00
Diego M. Rodriguez 4410e81660 Fix the tests for the C++ simulator changes
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).
2018-01-04 20:28:52 +01:00
Diego M. Rodriguez c29c2e58eb Style/lint fixes, make executable class-config
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.
2018-01-04 19:30:51 +01:00
Juan Gomez 7038d6278a Integrating C++ simulator with PIP installation
* 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
2018-01-04 19:12:59 +01:00
cjwood fde48f2bf7 renamed external folder to src 2018-01-03 17:13:57 +11:00
cjwood 6700afebb4 added top level make, added specific error message for incorrect file name 2018-01-03 17:13:57 +11:00
Diego M. Rodriguez 331d6b90d0 Add linter/style check to travis
* 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.
2017-12-29 10:44:35 +01:00
Rudy Raymond 00ae38c1f8 Added japanese doc for installation of QISKit (#140)
* 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
2017-11-08 18:13:43 +01:00
Diego M. Rodríguez b2d6e70229 Check IBMQuantumExperience version at runtime (#115)
* 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.
2017-10-25 10:12:04 -04:00
Diego M. Rodríguez 2200f14d2e Relax the default linter checks (#110)
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.
2017-10-10 14:43:29 +02:00
Diego M. Rodriguez 389123df46 Fix duplicated __init__ methods in autodocs 2017-09-22 19:08:14 +02:00
Diego M. Rodriguez 188ba7fff1 Fix sphinx apidoc warnings at standards module
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.
2017-09-18 20:18:55 +02:00
Diego M. Rodriguez 3673c74b6a Reorganize sphinx module stubs, TOC for apidoc
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.
2017-09-18 12:52:33 +02:00
Diego M. Rodriguez 247f8471ba Customize public qiskit apidoc documentation
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.
2017-09-18 12:52:00 +02:00
Erick Winston ad6e80a9e6 fixes issue #17
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.
2017-08-08 00:41:54 -04:00
Jay Gambetta 6938f499be Update Makefile 2017-08-04 16:38:49 -04:00
Erick Winston 9a4ea95e9f clean up docstrings to reduce autodoc errors. 2017-08-03 17:46:26 -04:00
ismael faro 9f70d204c0 Add Sphinx in requires.txt 2017-08-02 11:55:07 -04:00
ERICK B. WINSTON b9c51a64ff fix 'make doc' if qiskit not in python path. (#138) 2017-08-02 03:45:43 -04:00
Erick Winston 7c4902fc60 sphinx autodoc setup.
Documents the project source code from python docstrings. Run "make doc"
from the top level to generate the html in doc/_build/html.
2017-07-27 14:14:41 -04:00
Jay M. Gambetta ed42d2d5d8 fixing the make and qconfig 2017-07-27 11:59:40 -04:00
Jay M. Gambetta 2dd8ce5f3b moving things around for going public 2017-07-13 10:24:27 -04:00
ERICK B. WINSTON 89afa70546 Added unitary simulator test and moved tests around. (#72)
* Added unitary simulator test and moved tests around.
2017-07-07 13:33:21 -04:00
ERICK B. WINSTON 70b3bbbc30 Erick/discovery profiling (#68)
* 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.
2017-07-05 09:05:19 -04:00
Jesús Pérez 503933cb5b Fixed a bug in the Makefile.
The "env" task was calling himself recursively.
Other minor improvements.
2017-06-27 11:00:32 +02:00