From f687ec01993e53ee4adfe2ad25e28b1f059cc784 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 19 Aug 2021 10:36:37 -0500 Subject: [PATCH] Remove .buildkite --- .buildkite/default.nix | 1 - .buildkite/pipeline.nix | 181 ---------------------------- .buildkite/pipeline.yml | 13 -- .buildkite/shell.nix | 25 ---- ci.cue | 4 +- ets/README.md | 7 +- .buildkite/publish.sh => publish.sh | 0 shell.nix | 14 +-- test-ets-bitte.sh | 28 ----- test-ets.sh | 28 +---- 10 files changed, 13 insertions(+), 288 deletions(-) delete mode 100644 .buildkite/default.nix delete mode 100644 .buildkite/pipeline.nix delete mode 100644 .buildkite/pipeline.yml delete mode 100644 .buildkite/shell.nix rename .buildkite/publish.sh => publish.sh (100%) delete mode 100755 test-ets-bitte.sh diff --git a/.buildkite/default.nix b/.buildkite/default.nix deleted file mode 100644 index 469f15f296..0000000000 --- a/.buildkite/default.nix +++ /dev/null @@ -1 +0,0 @@ -import (import ../nix/sources.nix).nixkite diff --git a/.buildkite/pipeline.nix b/.buildkite/pipeline.nix deleted file mode 100644 index 99a5513d30..0000000000 --- a/.buildkite/pipeline.nix +++ /dev/null @@ -1,181 +0,0 @@ -{ cfg, pkgs, ... }: - -with cfg.steps.commands; -let - commonAttrs = { - retry.automatic = true; - agents.queue = "project42"; - }; -in -{ - steps.commands = { - nixExpr = commonAttrs // { - label = "ensure Nix expressions are up-to-date"; - command = '' - ./update-nix.sh --check - ''; - retry.automatic = false; - artifactPaths = [ - "nix-expr.patch" - ]; - }; - - scalafixAndFmt = commonAttrs // { - label = "scalafix & scalafmt"; - command = '' - nix-shell --run '$SBT formatCheck' - ''; - retry.automatic = false; - }; - - compile = commonAttrs // { - label = "compile everything"; - dependsOn = [ scalafixAndFmt ]; - command = '' - nix-shell --run '$SBT compile-all' - ''; - retry.automatic = false; - }; - - style = commonAttrs // { - dependsOn = [ compile ]; - label = "scalastyle"; - command = '' - nix-shell --run '$SBT scalastyle test:scalastyle' - ''; - retry.automatic = false; - }; - - test-bytes = commonAttrs // { - dependsOn = [ compile ]; - label = "bytes tests"; - command = '' - nix-shell --run '$SBT coverage bytes/test' - ''; - artifactPaths = [ - "bytes/target/test-reports/**/*" - "bytes/target/scala-2.13/scoverage-report/**/*" - "bytes/target/scala-2.13/coverage-report/**/*" - ]; - }; - - test-crypto = commonAttrs // { - dependsOn = [ compile ]; - label = "Crypto tests"; - command = '' - nix-shell --run '$SBT coverage crypto/test' - ''; - artifactPaths = [ - "crypto/target/test-reports/**/*" - "crypto/target/scala-2.13/scoverage-report/**/*" - "crypto/target/scala-2.13/coverage-report/**/*" - ]; - }; - - test-rlp = commonAttrs // { - dependsOn = [ compile ]; - label = "RLP tests"; - command = '' - nix-shell --run '$SBT coverage rlp/test' - ''; - artifactPaths = [ - "rlp/target/test-reports/**/*" - "rlp/target/scala-2.13/scoverage-report/**/*" - "rlp/target/scala-2.13/coverage-report/**/*" - ]; - }; - - test-unit = commonAttrs // { - dependsOn = [ compile ]; - label = "unit tests"; - command = '' - nix-shell --run '$SBT coverage test' - ''; - artifactPaths = [ - "target/test-reports/**/*" - "target/scala-2.13/scoverage-report/**/*" - "target/scala-2.13/coverage-report/**/*" - ]; - }; - - annotate-test-reports = commonAttrs // { - dependsOn = [ test-unit ]; - label = "annotate test reports"; - command = "junit-annotate"; - allowDependencyFailure = true; - plugins = [{ - "junit-annotate#1.9.0" = { - artifacts = "target/test-reports/*.xml"; - report-slowest = 50; - }; - }]; - }; - - test-evm = commonAttrs // { - dependsOn = [ compile ]; - label = "EVM tests"; - command = '' - nix-shell --run '$SBT coverage evm:test' - ''; - artifactPaths = [ - "target/test-reports/**/*" - "target/scala-2.13/scoverage-report/**/*" - "target/scala-2.13/coverage-report/**/*" - ]; - }; - - test-ets = commonAttrs // { - dependsOn = [ compile ]; - label = "ETS"; - command = '' - nix-shell --run './test-ets.sh' - ''; - softFail = true; - retry.automatic = false; - artifactPaths = [ - "mantis-log.txt" - "retesteth-GeneralStateTests-log.txt" - "retesteth-BlockchainTests-log.txt" - ]; - }; - - test-integration = commonAttrs // { - dependsOn = [ compile ]; - label = "integration tests"; - command = '' - nix-shell --run '$SBT coverageOff it:test' - ''; - artifactPaths = [ "target/test-reports/**/*" ]; - timeoutInMinutes = 60; - }; - - coverageReport = commonAttrs // { - dependsOn = [ test-unit test-evm ]; - label = "coverage report"; - command = '' - nix-shell --run '$SBT coverageReport coverageAggregate' - ''; - }; - - additional = commonAttrs // { - dependsOn = [ compile test-integration ]; - label = "additional compilation & dist"; - command = '' - nix-shell --run '$SBT benchmark:compile dist' - ''; - artifactPaths = [ - "target/universal/mantis-*.zip" - ]; - }; - - publish = commonAttrs // { - dependsOn = [ test-crypto test-rlp test-unit ]; - label = "Publishing libraries to Maven"; - command = '' - nix-env -iA nixpkgs.gnupg && nix-shell --run '.buildkite/publish.sh' - ''; - branches = "master develop"; - timeoutInMinutes = 30; - }; - }; -} diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index 7f91a3afff..0000000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,13 +0,0 @@ -steps: - - label: ":nix::point_right::pipeline:" - command: | - export NIX_PATH="nixpkgs=$(nix-instantiate --eval --strict --json --read-write-mode -E '(import nix/sources.nix).nixpkgs' | tr -d '"')" - nix-instantiate --eval --strict --json --expr '(import ./.buildkite { pipeline = ./.buildkite/pipeline.nix; })' \ - | buildkite-agent pipeline upload --no-interpolation - agents: - queue: project42 - timeout_in_minutes: 60 -# - label: "Mantis Automation" -# command: -# - "curl https://raw.githubusercontent.com/input-output-hk/mantis-automation/main/.buildkite/pipeline_erc20_pr.yml -o automation.yml" -# - "buildkite-agent pipeline upload automation.yml" diff --git a/.buildkite/shell.nix b/.buildkite/shell.nix deleted file mode 100644 index 3c24839eb5..0000000000 --- a/.buildkite/shell.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ sources, pkgs }: -let - # TODO, share this code with mantis build in this project - # sbt-protoc puts the scala plugin in /tmp/protobridge. - # it is in fact a shell script with a standard `#!/usr/bin/env sh` shebang - # that makes the Nix sandbox ANGRY and breaks all the things in a cryptic, - # hairpull-inducing way. So we gotta sed it out. Not the prettiest thing - # but it works. - protoc-wrapper = pkgs.writeShellScriptBin "protoc" '' - set -e - - for f in "$@"; do - echo ''${f##*=} - done | grep protocbridge | xargs sed -i "1s|.*|#!${pkgs.bash}/bin/bash|" - - exec ${pkgs.protobuf}/bin/protoc "$@" - ''; -in -with pkgs; - -mkShell { - nativeBuildInputs = [ sbt solc lllc jdk8 protoc-wrapper retesteth netcat-gnu ]; - # SBT = "sbt -v -mem 2048 -J-Xmx4g -Dsbt.ivy.home=/cache/ivy2 -Dsbt.boot.directory=/cache/sbt -Dmaven.repo.local=/cache/maven -Dnix=true"; - SBT = "sbt -v -mem 8192 -Dnix=true"; -} diff --git a/ci.cue b/ci.cue index 2f723c79b0..4482dffc2c 100644 --- a/ci.cue +++ b/ci.cue @@ -74,7 +74,7 @@ ci: { test_ets: { label: "ETS tests" after: ["compile"] - command: ["./test-ets-bitte.sh"] + command: ["./test-ets.sh"] outputs: [ "/local/repo/mantis-log.txt", "/local/repo/retesteth-GeneralStateTests-log.txt", @@ -100,7 +100,7 @@ ci: { publish: { label: "Publishing libraries to Maven" after: ["test_crypto", "test_rlp", "test_unit"] - command: [ ".buildkite/publish.sh" ] // TODO + command: [ "./publish.sh" ] // TODO outputs: [ "/local/repo/target/universal/mantis-*.zip", ] diff --git a/ets/README.md b/ets/README.md index f0317d053c..24dabf1fed 100644 --- a/ets/README.md +++ b/ets/README.md @@ -20,9 +20,8 @@ running them separately. ## Continous integration -The tests are run on CI. For more details look at `.buildkite/pipeline.nix` and -`test-ets.sh`. Output is stored as artifacts and a summary is added as -annotation. +The tests are run on CI. For more details look at `./ci.cue` and +`test-ets.sh`. Output is stored as artifacts. Two test suites are run; GeneralStateTests and BlockchainTests. These seem to be the only ones maintained and recommended at the moment. @@ -72,4 +71,4 @@ made by retesteth and also print out the state by using our `debug_*` endpoints. - `debug_accountRange` will only list accounts known at the genesis state. - `debug_storageRangeAt` is not able to show the state after an arbitrary transaction inside a block. -It will just return the state after all transaction in the block have run. \ No newline at end of file +It will just return the state after all transaction in the block have run. diff --git a/.buildkite/publish.sh b/publish.sh similarity index 100% rename from .buildkite/publish.sh rename to publish.sh diff --git a/shell.nix b/shell.nix index 319232a444..8cc7b75fcf 100644 --- a/shell.nix +++ b/shell.nix @@ -1,11 +1,7 @@ { sources ? import nix/sources.nix, pkgs ? import ./nix { } }: +with pkgs; -if __getEnv "BUILDKITE" == "true" then - import .buildkite/shell.nix { inherit sources pkgs; } -else - with pkgs; - - mkShell { - nativeBuildInputs = [ protobuf sbt ]; - inputsFrom = [ mantis ]; - } +mkShell { +nativeBuildInputs = [ protobuf sbt ]; +inputsFrom = [ mantis ]; +} diff --git a/test-ets-bitte.sh b/test-ets-bitte.sh deleted file mode 100755 index 665d679c25..0000000000 --- a/test-ets-bitte.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -git submodule init -git submodule update - -echo "booting Mantis and waiting for RPC API to be up" -$SBT -Dconfig.file=./src/main/resources/conf/testmode.conf run &> mantis-log.txt & - -while ! nc -z localhost 8546; do - sleep 0.1 -done - -final_exit_code=0 - -function run { - echo "running retesteth $1" - ets/retesteth -t "$1" &> "retesteth-$1-log.txt" - exit_code=$? - echo "retesteth $1 exit code: $exit_code" -} - -run "GeneralStateTests" -run "BlockchainTests" - -echo "shutting down mantis" -kill %1 - -exit $final_exit_code diff --git a/test-ets.sh b/test-ets.sh index be88b2d7ab..d27dda0d79 100755 --- a/test-ets.sh +++ b/test-ets.sh @@ -12,37 +12,15 @@ done final_exit_code=0 -function run_and_annotate { +function run { echo "running retesteth $1" timeout 15m ets/retesteth -t "$1" -- --verbosity 3 &> "retesteth-$1-log.txt" exit_code=$? echo "retesteth $1 exit code: $exit_code" - - style="info" - if [[ "$exit_code" -gt "0" ]]; then - final_exit_code="$exit_code" - style="error" - fi - - summary=$(sed -n '/Total Tests Run/,$p' "retesteth-$1-log.txt") - if [[ -z "$summary" ]]; then - summary="retesteth crashed; check the artifacts" - fi - passed=$(grep -oP 'Total Tests Run: \d+' "retesteth-$1-log.txt") - failed=$(grep -oP 'TOTAL ERRORS DETECTED: \d+' "retesteth-$1-log.txt") - - cat < -retesteth: $1 -- $passed -- $failed -

-$summary
-
- -EOF } -run_and_annotate "GeneralStateTests" -run_and_annotate "BlockchainTests" +run "GeneralStateTests" +run "BlockchainTests" echo "shutting down mantis" kill %1