Skip to content

Commit

Permalink
moving the tests to github actions variable parameters
Browse files Browse the repository at this point in the history
using TESTS as env, lets see
  • Loading branch information
mike dupont committed Sep 26, 2024
1 parent 05f8cd8 commit 61cb1df
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/run-docker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,38 @@ jobs:
run: docker pull ${{ inputs.image_url || env.default_image }}

- name: run the Docker tests
run: docker compose up ${{ env.container_name }}
run: docker compose up ${{ env.container_name }}-test1 -e TESTS="/app/src/lib/provable/test/merkle-list.test.ts"
# /app/src/lib/provable/test/merkle-tree.test.ts /app/src/lib/provable/test/scalar.test.ts /app/src/lib/provable/test/merkle-map.test.ts /app/src/lib/provable/test/provable.test.ts /app/src/lib/provable/test/primitives.test.ts /app/src/lib/provable/test/group.test.ts /app/src/lib/provable/test/int.test.ts /app/src/lib/mina/precondition.test.ts"
env:
DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}}

DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}}
- name: docker cp results
run: docker compose cp ${{ env.container_name }}:/tmp/perf.data.tar.gz perf.data.tar.gz

- name: Archive results
uses: meta-introspector/upload-artifact@v4
with:
name: perf.data.tar.gz
path: perf.data.tar.gz
- name: delete the results
run: rm -rf /tmp/perf*
- name: delete the container
run: |
docker-compose down
docker rm -f $(docker ps -a -q)
docker volume rm $(docker volume ls -q)
- name: run the Docker tests part 2
run: docker compose up ${{ env.container_name }}-test2
env:
DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}}

- name: docker cp results
run: docker compose cp ${{ env.container_name }}:/tmp/perf.data.tar.gz perf.data2.tar.gz
- name: Archive results
uses: meta-introspector/upload-artifact@v4
with:
name: perf.data2.tar.gz
path: perf.data2.tar.gz



7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,20 @@ services:
environment:
- PROOF_LEVEL=full
- LOG_LEVEL=Debug
working_dir: /app

# - TESTS=${TESTS}
working_dir: /app
# mount the source
volumes:
- type: bind
source: "/home/runner/work/o1js/o1js/"
target: "/opt/introspector/test/"

cap_add:
- SYS_PTRACE
- SYS_ADMIN

# run the test from the mounted source
command: "bash -x /opt/introspector/test/run-all-tests.sh"


reporting:
restart: no
image: ghcr.io/meta-introspector/o1js/o1js-perf-reporting:latest
Expand Down
2 changes: 1 addition & 1 deletion run-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pnpm install -g clinic
cd /app/
export SOURCE_DIR=/app/src
# limit to only working tests
TESTS="${SOURCE_DIR}/lib/provable/test/merkle-list.test.ts ${SOURCE_DIR}/lib/provable/test/merkle-tree.test.ts ${SOURCE_DIR}/lib/provable/test/scalar.test.ts ${SOURCE_DIR}/lib/provable/test/merkle-map.test.ts ${SOURCE_DIR}/lib/provable/test/provable.test.ts ${SOURCE_DIR}/lib/provable/test/primitives.test.ts ${SOURCE_DIR}/lib/provable/test/group.test.ts ${SOURCE_DIR}/lib/provable/test/int.test.ts ${SOURCE_DIR}/lib/mina/precondition.test.ts"
#TESTS="${SOURCE_DIR}/lib/provable/test/merkle-list.test.ts ${SOURCE_DIR}/lib/provable/test/merkle-tree.test.ts ${SOURCE_DIR}/lib/provable/test/scalar.test.ts ${SOURCE_DIR}/lib/provable/test/merkle-map.test.ts ${SOURCE_DIR}/lib/provable/test/provable.test.ts ${SOURCE_DIR}/lib/provable/test/primitives.test.ts ${SOURCE_DIR}/lib/provable/test/group.test.ts ${SOURCE_DIR}/lib/provable/test/int.test.ts ${SOURCE_DIR}/lib/mina/precondition.test.ts"
#${SOURCE_DIR}/lib/mina/token.test.ts"
# FIXME this all tests is not used because many of them fail.
ALL_TESTS=`ls -b ${SOURCE_DIR}/lib/provable/test/*.test.ts ${SOURCE_DIR}/lib/mina/*.test.ts `
Expand Down

0 comments on commit 61cb1df

Please sign in to comment.