Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip uninstallable tags in QPY backwards compatibility tests #13202

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
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
Next Next commit
Skip uninstallable tags in QPY backwards compatibility tests
When a tag has been made, but the package has not yet landed on PyPI,
the QPY job fails in the environment-building step.  This is not
actually a failure of the QPY backwards-compatibility guarantees, and
it isn't the job of the QPY tests to detect a bad tag anyway.
  • Loading branch information
jakelishman committed Sep 20, 2024
commit 3c08d440db6aac9ce99b05a42563f8070669c0e1
26 changes: 16 additions & 10 deletions test/qpy_compat/process_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ version=$1
parts=( ${version//./ } )
# 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=$(./qiskit_venv/bin/python -c "import qiskit;print(qiskit.__version__)")
qiskit_parts=( ${qiskit_version//./ } )


Expand All @@ -43,21 +43,27 @@ fi

if [[ ! -d qpy_$version ]] ; then
echo "Building venv for qiskit-terra $version"
python -m venv $version
python -m venv "$version"
if [[ ${parts[0]} -eq 0 ]] ; then
./$version/bin/pip install -c qpy_test_constraints.txt "qiskit-terra==$version"
if ! "./$version/bin/pip" install -c qpy_test_constraints.txt "qiskit-terra==$version"; then
jakelishman marked this conversation as resolved.
Show resolved Hide resolved
echo "Skipping uninstallable version $version";
exit 0;
fi
else
./$version/bin/pip install -c qpy_test_constraints.txt "qiskit==$version"
if ! "./$version/bin/pip" install -c qpy_test_constraints.txt "qiskit==$version"; then
echo "Skipping uninstallable version $version";
exit 0;
fi
fi
mkdir qpy_$version
pushd qpy_$version
mkdir "qpy_$version"
pushd "qpy_$version"
echo "Generating qpy files with qiskit-terra $version"
../$version/bin/python ../test_qpy.py generate --version=$version
"../$version/bin/python" ../test_qpy.py generate --version="$version"
else
echo "Using cached QPY files for $version"
pushd qpy_$version
pushd "qpy_$version"
fi
echo "Loading qpy files from $version with dev qiskit-terra"
../qiskit_venv/bin/python ../test_qpy.py load --version=$version
../qiskit_venv/bin/python ../test_qpy.py load --version="$version"
popd
rm -rf ./$version
rm -rf "./$version"
Loading