Skip to content

Commit

Permalink
Move test jobs to public runners (runtimeverification/pyk#929)
Browse files Browse the repository at this point in the history
~Blocked on #4059~

---------

Co-authored-by: devops <devops@runtimeverification.com>
  • Loading branch information
2 people authored and Baltoli committed Apr 10, 2024
1 parent f93f444 commit 7a170e7
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 105 deletions.
170 changes: 70 additions & 100 deletions pyk/.github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,50 +71,40 @@ jobs:
profile:
needs: code-quality-checks
name: 'Profiling'
runs-on: [self-hosted, linux, normal]
runs-on: [ubuntu-latest]
timeout-minutes: 10
strategy:
matrix:
python-version: ['3.10']
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Build Docker image'
- name: 'Install Python'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Install K'
run: |
COMMIT=$(git rev-parse --short=7 HEAD)
K_VERSION=$(cut --delim=v --field=2 deps/k_release)
docker build . \
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
--build-arg K_VERSION=${K_VERSION} \
--tag runtimeverificationinc/pyk-ci:${COMMIT}
docker run \
--name pyk-ci \
--rm \
--interactive \
--tty \
--detach \
--workdir /home/user \
runtimeverificationinc/pyk-ci:${COMMIT}
docker cp . pyk-ci:/home/user
docker exec pyk-ci chown -R user:user /home/user
- name: 'Set Python version'
run: docker exec --user user pyk-ci poetry env use ${{ matrix.python-version }}
- name: 'Build and run integration tests'
K_VERSION=$(cat deps/k_release)
DEB_PACKAGE_NAME=kframework_${K_VERSION}_amd64_ubuntu_jammy.deb
wget https://github.com/runtimeverification/k/releases/download/v${K_VERSION}/${DEB_PACKAGE_NAME}
sudo apt-get update
sudo apt-get -y install ./${DEB_PACKAGE_NAME}
- name: 'Set up Java'
run: |
docker exec --user user pyk-ci make profile
docker exec --user user pyk-ci bash -c "find /tmp/pytest-of-${USER}/pytest-current/ -type f -name '*.prof' | sort | xargs tail -n +1"
- name: 'Tear down Docker container'
if: always()
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
java --version
- name: 'Run profiling'
run: |
docker stop --time=0 pyk-ci
make profile PROF_ARGS=-n4
find /tmp/pytest-of-${USER}/pytest-current/ -type f -name '*.prof' | sort | xargs tail -n +1
integration-tests:
needs: code-quality-checks
name: 'Integration Tests'
runs-on: [self-hosted, linux, normal]
runs-on: [ubuntu-latest]
timeout-minutes: 30
strategy:
fail-fast: false
Expand All @@ -123,35 +113,57 @@ jobs:
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Build Docker image'
- name: 'Install Python'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Install K'
run: |
COMMIT=$(git rev-parse --short=7 HEAD)
K_VERSION=$(cut --delim=v --field=2 deps/k_release)
docker build . \
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
--build-arg K_VERSION=${K_VERSION} \
--tag runtimeverificationinc/pyk-ci:${COMMIT}
docker run \
--name pyk-ci \
--rm \
--interactive \
--tty \
--detach \
--workdir /home/user \
runtimeverificationinc/pyk-ci:${COMMIT}
K_VERSION=$(cat deps/k_release)
DEB_PACKAGE_NAME=kframework_${K_VERSION}_amd64_ubuntu_jammy.deb
wget https://github.com/runtimeverification/k/releases/download/v${K_VERSION}/${DEB_PACKAGE_NAME}
sudo apt-get update
sudo apt-get -y install graphviz ./${DEB_PACKAGE_NAME}
- name: 'Set up Java'
run: |
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
java --version
- name: 'Run integration tests'
run: make cov-integration COV_ARGS='-n4 --timeout 500'

docker cp . pyk-ci:/home/user
docker exec pyk-ci chown -R user:user /home/user
- name: 'Set Python version'
run: docker exec --user user pyk-ci poetry env use ${{ matrix.python-version }}
- name: 'Build and run integration tests'
run: docker exec --user user pyk-ci make cov-integration COV_ARGS='-n8 --timeout 500'
- name: 'Tear down Docker container'
if: always()
regression-tests:
needs: code-quality-checks
name: 'K Regression Tests'
runs-on: [ubuntu-latest]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Install Python'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v8
- name: 'Install K'
run: |
K_VERSION=$(cat deps/k_release)
DEB_PACKAGE_NAME=kframework_${K_VERSION}_amd64_ubuntu_jammy.deb
wget https://github.com/runtimeverification/k/releases/download/v${K_VERSION}/${DEB_PACKAGE_NAME}
sudo apt-get update
sudo apt-get -y install graphviz ./${DEB_PACKAGE_NAME}
- name: 'Set up Java'
run: |
docker stop --time=0 pyk-ci
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
java --version
- name: 'Run K regression tests'
run: make test-regression-new -j4

build-on-nix:
needs: code-quality-checks
Expand Down Expand Up @@ -179,13 +191,13 @@ jobs:

build-docker:
needs: integration-tests
name: 'Build docker image for release'
name: 'Build Docker Image'
runs-on: [self-hosted, linux, normal]
timeout-minutes: 10
steps:
- name: 'Check out code'
uses: actions/checkout@v4
- name: 'Build Docker image for release'
- name: 'Build Docker image'
run: |
COMMIT=$(git rev-parse --short=7 HEAD)
K_VERSION=$(cut --delim=v --field=2 deps/k_release)
Expand All @@ -199,45 +211,3 @@ jobs:
docker run --rm runtimeverificationinc/kframework-pyk:${COMMIT}
docker run --rm runtimeverificationinc/kframework-pyk:${COMMIT} kompile --version
regression-new-tests:
needs: code-quality-checks
name: 'K Regression Tests'
runs-on: [self-hosted, linux, normal]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Build Docker image'
run: |
COMMIT=$(git rev-parse --short=7 HEAD)
K_VERSION=$(cut --delim=v --field=2 deps/k_release)
docker build . \
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
--build-arg K_VERSION=${K_VERSION} \
--tag runtimeverificationinc/pyk-ci:${COMMIT}
docker run \
--name pyk-ci \
--rm \
--interactive \
--tty \
--detach \
--workdir /home/user \
runtimeverificationinc/pyk-ci:${COMMIT}
docker cp . pyk-ci:/home/user
docker exec pyk-ci chown -R user:user /home/user
- name: 'Set Python version'
run: docker exec --user user pyk-ci poetry env use ${{ matrix.python-version }}
- name: 'Build and run integration tests'
run: docker exec --user user pyk-ci make test-regression-new -j8
- name: 'Tear down Docker container'
if: always()
run: |
docker stop --time=0 pyk-ci
4 changes: 2 additions & 2 deletions pyk/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
project = 'pyk'
author = 'Runtime Verification, Inc'
copyright = '2024, Runtime Verification, Inc'
version = '0.1.709'
release = '0.1.709'
version = '0.1.710'
release = '0.1.710'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion pyk/package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.709
0.1.710
2 changes: 1 addition & 1 deletion pyk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pyk"
version = "0.1.709"
version = "0.1.710"
description = ""
authors = [
"Runtime Verification, Inc. <contact@runtimeverification.com>",
Expand Down
2 changes: 1 addition & 1 deletion pyk/src/pyk/testing/_kompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class KoreClientTest(KompiledTest):
KOMPILE_BACKEND: ClassVar = 'haskell'
LLVM_ARGS: ClassVar[dict[str, Any]] = {}

CLIENT_TIMEOUT: ClassVar = 1000
CLIENT_TIMEOUT: ClassVar = 2000

@pytest.fixture(scope='class', params=['legacy', 'booster'])
def server_type(self, request: FixtureRequest, use_server: UseServer) -> ServerType:
Expand Down

0 comments on commit 7a170e7

Please sign in to comment.