Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix testool manifest and add test it in github actions (#1535)
Browse files Browse the repository at this point in the history
### Description

Testool failed to compile after
#1524,
this is due:

- testool compilation is not checked in github actions
- some functions required are not only available without `test-circuits`
feature

### Type of change

Bug fix (non-breaking change which fixes an issue)

### Contents

- Fixes Cargo.toml
- Adds basic test of testool in github actions

---------

Co-authored-by: adria0 <adria0@nowhere>
  • Loading branch information
adria0 and adria0 committed Jul 21, 2023
1 parent 26bf6ba commit 350a7a2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ jobs:
with:
command: test
args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --test-threads 1

- name: Run testool internal tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release --manifest-path testool/Cargo.toml
build:
needs: [skip_check]
if: |
Expand Down
3 changes: 1 addition & 2 deletions testool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ strum_macros = "0.24"
thiserror = "1.0"
toml = "0.5"
yaml-rust = "0.4.5"
zkevm-circuits = { path="../zkevm-circuits", features=["test-util"] }
zkevm-circuits = { path="../zkevm-circuits", features=["test-util", "test-circuits"] }
rand_chacha = "0.3"
rand = "0.8"
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_04_20" }
Expand All @@ -38,4 +38,3 @@ urlencoding = "2.1.2"

[features]
default = []
ignore-test-docker = []
8 changes: 8 additions & 0 deletions testool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ To use it, just compile with `cargo build --release` and run `../target/release/

This tool at this moment has 2 main functionalities: run raw bytecode and run ethereum tests.


## Setup docker

Code is precompiled and kept in the `codehash.txt`` file, if you need to compile more code (mainly because you are updating the testspecs commit), you have to setup docker:

- `docker build docker/lllc -t lllc`
- `docker build docker/solc -t solc`

## Run oneliner spec

The oneliner spec is invoked by using `--oneliner` parameter
Expand Down
6 changes: 3 additions & 3 deletions testool/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl Compiler {
#[cfg(test)]
mod test {
#[test]
#[cfg(not(feature = "ignore-test-docker"))]
#[ignore]
fn test_docker_lll() -> anyhow::Result<()> {
let out = super::Compiler::new(true, None)?.lll(
"[[0]] (+ 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 4)",
Expand All @@ -332,7 +332,7 @@ mod test {
Ok(())
}
#[test]
#[cfg(not(feature = "ignore-test-docker"))]
#[ignore]
fn test_docker_yul() -> anyhow::Result<()> {
let out = super::Compiler::new(true, None)?.yul(
r#"
Expand All @@ -355,7 +355,7 @@ mod test {
Ok(())
}
#[test]
#[cfg(not(feature = "ignore-test-docker"))]
#[ignore]
fn test_docker_solidity() -> anyhow::Result<()> {
let out = super::Compiler::new(true, None)?.solidity("contract A{}")?;
assert_eq!(
Expand Down
3 changes: 0 additions & 3 deletions testool/test-docker.sh

This file was deleted.

0 comments on commit 350a7a2

Please sign in to comment.