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

Commit

Permalink
imp(tests): integration tests setup (#1196)
Browse files Browse the repository at this point in the history
* first pass

* latest

* working tests

* github actions

* remove unnecessary change

* remove unnecessary steps

* remove unnecessary import

* remove unnecessary change

* Update .github/workflows/test.yml

Co-authored-by: yihuang <huang@crypto.com>

* update .gitignore

* update github actions

* change evm denomination

* change evm denomination

* send tests to tests folder

* Delete result

* update go version

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 27, 2022
1 parent 3460cba commit fd0e62a
Show file tree
Hide file tree
Showing 35 changed files with 29,987 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ jobs:
make test-integration
if: env.GIT_DIFF

integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: ethermint
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: Run integration tests
run: make run-integration-tests
if: env.GIT_DIFF
- name: 'Tar debug files'
if: failure()
run: tar cfz debug_files.tar.gz -C /tmp/pytest-of-runner .
- uses: actions/upload-artifact@v2
if: failure()
with:
name: debug-files
path: debug_files.tar.gz
if-no-files-found: ignore

test-sim-nondeterminism:
runs-on: ubuntu-latest
timeout-minutes: 25
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ dependency-graph.png

# Node.js
tests/**/node_modules/*
tests-solidity/**/node_modules/*
tests-solidity/**/node_modules/*

# Nix
/result
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ test-rpc:
test-integration:
./scripts/integration-test-all.sh -t "integration" -q 1 -z 1 -s 2 -m "integration" -r "true"

run-integration-tests:
@nix-shell ./tests/integration_tests/shell.nix --run ./scripts/run-integration-tests.sh

.PHONY: run-integration-tests


test-rpc-pending:
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"

Expand Down
47 changes: 47 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ lib
, buildGoApplication
, nix-gitignore
, rev ? "dirty"
}:
let
version = "v0.17.1";
pname = "ethermintd";
tags = [ "ledger" "netgo" ];
ldflags = lib.concatStringsSep "\n" ([
"-X github.com/cosmos/cosmos-sdk/version.Name=ethermint"
"-X github.com/cosmos/cosmos-sdk/version.AppName=${pname}"
"-X github.com/cosmos/cosmos-sdk/version.Version=${version}"
"-X github.com/cosmos/cosmos-sdk/version.BuildTags=${lib.concatStringsSep "," tags}"
"-X github.com/cosmos/cosmos-sdk/version.Commit=${rev}"
]);
in
buildGoApplication rec {
inherit pname version tags ldflags;
src = (nix-gitignore.gitignoreSourcePure [
"../*" # ignore all, then add whitelists
"!../x/"
"!../app/"
"!../cmd/"
"!../client/"
"!../server/"
"!../crypto/"
"!../rpc/"
"!../types/"
"!../encoding/"
"!../go.mod"
"!../go.sum"
"!../gomod2nix.toml"
] ./.);
modules = ./gomod2nix.toml;
doCheck = false;
pwd = src; # needed to support replace
subPackages = [ "cmd/ethermintd" ];
CGO_ENABLED = "1";

meta = with lib; {
description = "Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the Cosmos SDK which runs on top of Tendermint Core consensus engine.";
homepage = "https://github.com/evmos/ethermint";
license = licenses.asl20;
mainProgram = "ethermintd";
};
}
Loading

0 comments on commit fd0e62a

Please sign in to comment.