Skip to content

Commit

Permalink
feat: add CI integration test with prover
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyrd committed Oct 28, 2024
1 parent f519b6e commit c6fd9e6
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,30 @@ jobs:
- name: Kill miden-node
if: always()
run: make kill-node

remote_prover_integration_tests_web_client:
name: integration_tests_web_client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install Rust
run: |
rustup update --no-self-update
rustup target add wasm32-unknown-unknown
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- run: make clean-node
- run: make node
- run: make start-node > /dev/null &
- run: make clean-prover
- run: make prover
- run: make start-prover > /dev/null &
- run: make prover-integration-test-web-client
- name: Kill miden-node
if: always()
run: make kill-node
- name: Kill miden-prover
if: always()
run: make kill-prover
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ FEATURES_CLI=--features "testing, concurrent"
NODE_FEATURES_TESTING=--features "testing"
WARNINGS=RUSTDOCFLAGS="-D warnings"
NODE_BRANCH="next"
PROVER_BRANCH="tomyrd-lazy-remote-prover-connection"
PROVER_FEATURES_TESTING=--features "testing"

# --- Linting -------------------------------------------------------------------------------------

Expand Down Expand Up @@ -84,6 +86,10 @@ integration-test: ## Run integration tests
integration-test-web-client: ## Run integration tests for the web client
cd ./crates/web-client && npm run test:clean

.PHONY: prover-integration-test-web-client
prover-integration-test-web-client: ## Run integration tests for the web client with remote prover
cd ./crates/web-client && npm run test:remote_prover

.PHONY: integration-test-full
integration-test-full: ## Run the integration test binary with ignored tests included
cargo nextest run --workspace --exclude miden-client-web --release --test=integration $(FEATURES_CLI)
Expand All @@ -108,6 +114,24 @@ node: ## Setup node directory
start-node: ## Run node. This requires the node repo to be present at `miden-node`
cd miden-node && cargo run --bin miden-node $(NODE_FEATURES_TESTING) -- start --config ../tests/config/miden-node.toml node

.PHONY: clean-prover
clean-prover: ## Clean prover directory
rm -rf miden-base

.PHONY: prover
prover: ## Setup prover directory
if [ -d miden-base ]; then cd miden-base; else git clone https://github.com/0xPolygonMiden/miden-base.git && cd miden-base; fi
cd miden-base && git checkout $(PROVER_BRANCH) && git pull origin $(PROVER_BRANCH)
cd miden-base && cargo update

.PHONY: start-prover
start-prover: ## Run prover. This requires the base repo to be present at `miden-base`
cd miden-base && RUST_LOG=info cargo run --bin miden-tx-prover --locked $(PROVER_FEATURES_TESTING)

.PHONY: kill-prover
kill-prover: ## Kill prover process
pkill miden-tx-prover || echo 'process not running'

# --- Installing ----------------------------------------------------------------------------------

install: ## Install the CLI binary
Expand Down
2 changes: 1 addition & 1 deletion crates/web-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"scripts": {
"build": "rimraf dist && rollup -c rollup.config.js && cpr js/types dist && node clean.js",
"test": "node --loader ts-node/esm ./node_modules/mocha/bin/mocha --file ./test/mocha.global.setup.mjs",
"test:remote": "npm install && MIDEN_WEB_TESTING=true npm run build && cross-env REMOTE_PROVER=true node --loader ts-node/esm ./node_modules/mocha/bin/mocha --file ./test/mocha.global.setup.mjs",
"test:remote_prover": "npm install && MIDEN_WEB_TESTING=true npm run build && cross-env REMOTE_PROVER=true node --loader ts-node/esm ./node_modules/mocha/bin/mocha --file ./test/mocha.global.setup.mjs",
"test:logs": "cross-env DEBUG_MODE=true node --loader ts-node/esm --loader esm ./node_modules/mocha/bin/mocha --file ./test/mocha.global.setup.mjs",
"test:clean": "npm install && MIDEN_WEB_TESTING=true npm run build && node --loader ts-node/esm --loader esm ./node_modules/mocha/bin/mocha --file ./test/mocha.global.setup.mjs"
},
Expand Down

0 comments on commit c6fd9e6

Please sign in to comment.