Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion test/qpy_compat/process_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,23 @@
set -e
set -x

# version is the source version, this is the release with which to generate
# qpy files with to load with the version under test
version=$1
parts=( ${version//./ } )
if [[ ${parts[1]} -lt 18 ]] ; then
# qiskit_version is the version under test, We're testing that we can correctly
# read the qpy files generated with source version with this version.
qiskit_version=`../qiskit_venv/bin/python -c "import qiskit;print(qiskit.__version__)"`
qiskit_version_pars = ( ${qiskit_version//./ } )
Comment thread
mtreinish marked this conversation as resolved.
Outdated

# If source version is less than 0.18 QPY didn't exist yet so exit fast
if [[ ${parts[0]} -eq 0 && ${parts[1]} -lt 18 ]] ; then
exit 0
fi
# If the source version is newer than the version under test exit fast because
# there is no QPY compatibility for loading a qpy file generated from a newer
# release with an older release of Qiskit.
if [[ ${parts[0]} -gt ${qiskit_parts[0]} || ${parts[1]} -gt ${qiskit_parts[1]} ]] ; then
Comment thread
mtreinish marked this conversation as resolved.
Outdated
exit 0
fi

Expand Down