Skip to content

Commit

Permalink
feat: New folder for selfhosted
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Feb 6, 2025
1 parent cb89902 commit 1bbd208
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions selfhosted
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
#!/bin/bash

# Script for running the selfhosted tests on QPUs directly from GitHub
# Script for running the self-hosted tests on QPUs directly from GitHub
# Tests need to be copied to /tmp/ because coverage does not work with NFS

cp -r src/qibojit/tests /tmp/
cp pyproject.toml /tmp/
cd /tmp/tests
# Create a unique temporary directory
TMP_DIR=$(mktemp -d /tmp/qibojit.XXXXXX)

# Copy tests to the temporary directory
cp -r src/qibojit/tests "$TMP_DIR"
cp pyproject.toml "$TMP_DIR/"
cd "$TMP_DIR/tests"

# Activate the test environment
source /nfs/users/github/actions-runner/_work/qibojit/qibojit/testenv/bin/activate

# Run tests
pytest
pytest_status=$?
if [[ $pytest_status -ne 0 ]]
then
exit $pytest_status

# Exit if tests fail
if [[ $pytest_status -ne 0 ]]; then
exit $pytest_status
fi

# Return to the original directory
cd -
mv /tmp/tests/coverage.xml .
mv /tmp/tests/htmlcov .
rm -r /tmp/tests

# Move coverage results
mv "$TMP_DIR/tests/coverage.xml" .
mv "$TMP_DIR/tests/htmlcov" .

# Clean up
rm -r "$TMP_DIR"

0 comments on commit 1bbd208

Please sign in to comment.