diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4984fe92e9..34ab2aed83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,3 +109,25 @@ jobs: - name: 'instantiate integration test env' if: steps.changed-files.outputs.only_changed == 'false' run: nix-store -r $(nix-instantiate integration_tests/shell.nix) + + testground-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-22.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - uses: cachix/cachix-action@v12 + with: + name: cronos + # github don't pass secrets for pull request from fork repos, + # in that case the push is disabled naturally. + signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" + - name: Run tests + run: | + cd testground/benchmark + nix develop -c pytest -vv -s diff --git a/flake.nix b/flake.nix index 7649379adc..b5d6d9a164 100644 --- a/flake.nix +++ b/flake.nix @@ -81,6 +81,7 @@ go = super.go_1_22; test-env = final.callPackage ./nix/testenv.nix { }; cronos-matrix = final.callPackage ./nix/cronos-matrix.nix { + inherit rev; bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { }; }; testground-image = final.callPackage ./nix/testground-image.nix { }; diff --git a/go.mod b/go.mod index 9426b886f0..fef5bc6d5f 100644 --- a/go.mod +++ b/go.mod @@ -276,7 +276,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a // develop - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240925075331-975533377be3 + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240925024103-f2a562ba9b9f // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 diff --git a/go.sum b/go.sum index c395be86d1..57a2b86cdb 100644 --- a/go.sum +++ b/go.sum @@ -426,8 +426,8 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240916022730-3317ca17f0f1 github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240916022730-3317ca17f0f1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1 h1:yKiDUGCgeFiM5RLwS8IPp0BmdQANVJN7qDTCdFCPLyE= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240925075331-975533377be3 h1:CoxvnUYWDP8Oqy2+DPLe01ZYuieqPkZAvi+phF0unZQ= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240925075331-975533377be3/go.mod h1:OdJ/GKqAN/vDw2UFBc7kmA8pvk7XQz7rWR/8RmWoTD0= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240925024103-f2a562ba9b9f h1:Moucz7HfXoyNishzeMJOVbUdeLueOMAbNwnEN5M+iS8= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240925024103-f2a562ba9b9f/go.mod h1:D2lnc8ARuVmgc2/2IWla2Ky1o8/pjmyrnIt+d46Clco= github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI= github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a h1:IUPD+dg1YQl8cLocxQ/Mbx/ObTgAgcrZlcBhFjsLO40= diff --git a/gomod2nix.toml b/gomod2nix.toml index f0405b6d40..bcb2144a15 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -261,8 +261,8 @@ schema = 3 hash = "sha256-ozwVS2BhAoz+OOisAyMhgg+lq8FdQjf90xoOq9cxtGw=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20240925075331-975533377be3" - hash = "sha256-5d0/7zWLTml1w8AkNBLZUjzKhcACVu7VD8XYdf3nvxU=" + version = "v0.6.1-0.20240925024103-f2a562ba9b9f" + hash = "sha256-x4DWoXapGF4PmU78TchdrT9Km1hXWrrqV6bIry3J6Sk=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/fatih/color"] version = "v1.16.0" diff --git a/scripts/release.sh b/scripts/release.sh index 68f35ab61d..3be3b5a07c 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -28,7 +28,7 @@ build() { fi fi echo "building $FLAKE" - nix build -L "$FLAKE" + nix build --no-update-lock-file --no-allow-dirty -L "$FLAKE" cp result "cronos_${ref_name_clean:1}${network}_${name}.tar.gz" } diff --git a/testground/benchmark/benchmark/erc20.py b/testground/benchmark/benchmark/erc20.py new file mode 100644 index 0000000000..de9f0c90bc --- /dev/null +++ b/testground/benchmark/benchmark/erc20.py @@ -0,0 +1,52 @@ +import eth_abi +from eth_hash.auto import keccak +from hexbytes import HexBytes + +from .utils import eth_to_bech32 + +INITIAL_AMOUNT = 100000000000000000 +CONTRACT_ADDRESS = "0x1" + "0" * 39 + + +def genesis_accounts(contract_address, addresses) -> (list, list): + """ + return list of evm genesis accounts and auth genesis accounts + """ + amount = eth_abi.encode(["uint"], [INITIAL_AMOUNT]) + balances = [ + { + "key": keccak(eth_abi.encode(["address", "uint"], [addr, 0])).hex(), + "value": amount.hex(), + } + for addr in addresses + ] + evm = [ + { + "address": contract_address, + "code": bytecode, + "storage": [ + { + # Total supply + "key": HexBytes(eth_abi.encode(["uint"], [2])).hex(), + "value": "0x1" + "0" * 63, + }, + ] + + balances, + } + ] + + auth = [ + { + "@type": "/ethermint.types.v1.EthAccount", + "base_account": { + "address": eth_to_bech32(contract_address), + "sequence": "1", + }, + "code_hash": keccak(bytes.fromhex(bytecode)).hex(), + } + ] + + return evm, auth + + +bytecode = "608060405234801561001057600080fd5b50600436106100ea5760003560e01c806395d89b411161008c578063d3d78b9b11610066578063d3d78b9b146102cc578063dd62ed3e14610300578063e6711ef61461032e578063e978206414610336576100ea565b806395d89b411461026c578063a457c2d714610274578063a9059cbb146102a0576100ea565b806323b872dd116100c857806323b872dd146101c6578063313ce567146101fc578063395093511461021a57806370a0823114610246576100ea565b806306fdde03146100ef578063095ea7b31461016c57806318160ddd146101ac575b600080fd5b6100f7610362565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610131578181015183820152602001610119565b50505050905090810190601f16801561015e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101986004803603604081101561018257600080fd5b506001600160a01b0381351690602001356103f8565b604080519115158252519081900360200190f35b6101b4610415565b60408051918252519081900360200190f35b610198600480360360608110156101dc57600080fd5b506001600160a01b0381358116916020810135909116906040013561041b565b6102046104a8565b6040805160ff9092168252519081900360200190f35b6101986004803603604081101561023057600080fd5b506001600160a01b0381351690602001356104b1565b6101b46004803603602081101561025c57600080fd5b50356001600160a01b0316610505565b6100f7610520565b6101986004803603604081101561028a57600080fd5b506001600160a01b038135169060200135610581565b610198600480360360408110156102b657600080fd5b506001600160a01b0381351690602001356105ef565b6102fe600480360360608110156102e257600080fd5b506001600160a01b038135169060208101359060400135610603565b005b6101b46004803603604081101561031657600080fd5b506001600160a01b03813581169160200135166106ad565b6101b46106d8565b6102fe6004803603604081101561034c57600080fd5b506001600160a01b0381351690602001356106dd565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103ee5780601f106103c3576101008083540402835291602001916103ee565b820191906000526020600020905b8154815290600101906020018083116103d157829003601f168201915b5050505050905090565b600061040c61040561070b565b848461070f565b50600192915050565b60025490565b60006104288484846107fb565b61049e8461043461070b565b61049985604051806060016040528060288152602001610d33602891396001600160a01b038a1660009081526001602052604081209061047261070b565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61096216565b61070f565b5060019392505050565b60055460ff1690565b600061040c6104be61070b565b8461049985600160006104cf61070b565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6109f916565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103ee5780601f106103c3576101008083540402835291602001916103ee565b600061040c61058e61070b565b8461049985604051806060016040528060258152602001610dc560259139600160006105b861070b565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61096216565b600061040c6105fc61070b565b84846107fb565b81810182811015610654576040805162461bcd60e51b8152602060048201526016602482015275736166652d6d6174682d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b61065e3382610a5a565b604080516001600160a01b03861681526020810185905280820184905290517f937492d2511a2fbc9b51ea08825f1e252247d339dfd50904ebf4f4411f1d81369181900360600190a150505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b602a90565b337389a7ef2f08b1c018d5cc88836249b84dd5392905146106fd57600080fd5b6107078282610b62565b5050565b3390565b6001600160a01b0383166107545760405162461bcd60e51b8152600401808060200182810382526024815260200180610da16024913960400191505060405180910390fd5b6001600160a01b0382166107995760405162461bcd60e51b8152600401808060200182810382526022815260200180610ceb6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166108405760405162461bcd60e51b8152600401808060200182810382526025815260200180610d7c6025913960400191505060405180910390fd5b6001600160a01b0382166108855760405162461bcd60e51b8152600401808060200182810382526023815260200180610ca66023913960400191505060405180910390fd5b610890838383610c5e565b6108d381604051806060016040528060268152602001610d0d602691396001600160a01b038616600090815260208190526040902054919063ffffffff61096216565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610908908263ffffffff6109f916565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156109f15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109b657818101518382015260200161099e565b50505050905090810190601f1680156109e35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610a53576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610a9f5760405162461bcd60e51b8152600401808060200182810382526021815260200180610d5b6021913960400191505060405180910390fd5b610aab82600083610c5e565b610aee81604051806060016040528060228152602001610cc9602291396001600160a01b038516600090815260208190526040902054919063ffffffff61096216565b6001600160a01b038316600090815260208190526040902055600254610b1a908263ffffffff610c6316565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038216610bbd576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b610bc960008383610c5e565b600254610bdc908263ffffffff6109f916565b6002556001600160a01b038216600090815260208190526040902054610c08908263ffffffff6109f916565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b505050565b6000610a5383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061096256fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212203ad18e3c8894a8cb3aa50316961c792e96a3dfb497a816e09208ce0d7d83fe1364736f6c63430006060033" # noqa diff --git a/testground/benchmark/benchmark/peer.py b/testground/benchmark/benchmark/peer.py index a43a082bad..83da764961 100644 --- a/testground/benchmark/benchmark/peer.py +++ b/testground/benchmark/benchmark/peer.py @@ -7,9 +7,17 @@ import jsonmerge from pydantic.json import pydantic_encoder +from . import erc20 from .cli import ChainCommand from .types import Balance, GenesisAccount, PeerPacket -from .utils import eth_to_bech32, gen_account, patch_json, patch_toml +from .utils import ( + bech32_to_eth, + eth_to_bech32, + gen_account, + merge_genesis, + patch_genesis, + patch_toml, +) DEFAULT_DENOM = "basecro" VAL_ACCOUNT = "validator" @@ -103,13 +111,21 @@ def gen_genesis( collect_gen_tx(cli, peers, home=leader_home) cli("genesis", "validate", home=leader_home) print("genesis validated") - return patch_json( + + evm_accounts, auth_accounts = erc20.genesis_accounts( + erc20.CONTRACT_ADDRESS, [bech32_to_eth(acct.address) for acct in accounts] + ) + return patch_genesis( leader_home / "config" / "genesis.json", - jsonmerge.merge( + merge_genesis( { "consensus": {"params": {"block": {"max_gas": "163000000"}}}, "app_state": { - "evm": {"params": {"evm_denom": "basecro"}}, + "evm": { + "params": {"evm_denom": DEFAULT_DENOM}, + "accounts": evm_accounts, + }, + "auth": {"accounts": auth_accounts}, "feemarket": {"params": {"no_base_fee": True}}, }, }, diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index b70184f1cd..f94658f326 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -56,6 +56,7 @@ def validate_json(ctx, param, value): @click.option("--fullnodes", default=7) @click.option("--num-accounts", default=10) @click.option("--num-txs", default=1000) +@click.option("--tx-type", default="simple-transfer") @click.option("--config-patch", default="{}", callback=validate_json) @click.option("--app-patch", default="{}", callback=validate_json) @click.option("--genesis-patch", default="{}", callback=validate_json) @@ -77,6 +78,7 @@ def _gen( fullnodes: int = 7, num_accounts: int = 10, num_txs: int = 1000, + tx_type: str = "simple-transfer", validator_generate_load: bool = True, config_patch: dict = None, app_patch: dict = None, @@ -138,6 +140,7 @@ def _gen( "fullnodes": fullnodes, "num_accounts": num_accounts, "num_txs": num_txs, + "tx_type": tx_type, "validator-generate-load": validator_generate_load, } (outdir / "config.json").write_text(json.dumps(cfg)) @@ -203,6 +206,7 @@ def run(outdir: str, datadir: str, cronosd, global_seq): @click.option("--nodes", default=10) @click.option("--num-accounts", default=10) @click.option("--num-txs", default=1000) +@click.option("--tx-type", default="simple-transfer") @click.option("--node", type=int) def gen_txs(**kwargs): return _gen_txs(**kwargs) @@ -219,13 +223,14 @@ def _gen_txs( nodes: int = 10, num_accounts: int = 10, num_txs: int = 1000, + tx_type: str = "simple-transfer", node: Optional[int] = None, ): outdir = Path(outdir) def job(global_seq): print("generating", num_accounts * num_txs, "txs for node", global_seq) - txs = transaction.gen(global_seq, num_accounts, num_txs) + txs = transaction.gen(global_seq, num_accounts, num_txs, tx_type) transaction.save(txs, outdir, global_seq) print("saved", len(txs), "txs for node", global_seq) @@ -245,7 +250,9 @@ def do_run( print("loaded", len(txs), "txs") else: print("generating", cfg["num_accounts"] * cfg["num_txs"], "txs") - txs = transaction.gen(global_seq, cfg["num_accounts"], cfg["num_txs"]) + txs = transaction.gen( + global_seq, cfg["num_accounts"], cfg["num_txs"], cfg["tx_type"] + ) else: txs = [] diff --git a/testground/benchmark/benchmark/test_utils.py b/testground/benchmark/benchmark/test_utils.py new file mode 100644 index 0000000000..49ed0356fd --- /dev/null +++ b/testground/benchmark/benchmark/test_utils.py @@ -0,0 +1,9 @@ +from .utils import merge_genesis + + +def test_merge_genesis(): + g = merge_genesis( + {"app_state": {"auth": {"accounts": [1]}}}, + {"app_state": {"auth": {"accounts": [2]}}}, + ) + assert g["app_state"]["auth"]["accounts"] == [1, 2] diff --git a/testground/benchmark/benchmark/transaction.py b/testground/benchmark/benchmark/transaction.py index 3d95c2709a..1886eb54c2 100644 --- a/testground/benchmark/benchmark/transaction.py +++ b/testground/benchmark/benchmark/transaction.py @@ -2,8 +2,10 @@ from pathlib import Path import aiohttp +import eth_abi import ujson +from .erc20 import CONTRACT_ADDRESS from .utils import gen_account GAS_PRICE = 1000000000 @@ -11,11 +13,12 @@ LOCAL_JSON_RPC = "http://localhost:8545" CONNECTION_POOL_SIZE = 1024 TXS_DIR = "txs" +RECIPIENT = "0x1" + "0" * 39 -def test_tx(nonce: int): +def simple_transfer_tx(nonce: int): return { - "to": "0x0000000000000000000000000000000000000000", + "to": RECIPIENT, "value": 1, "nonce": nonce, "gas": 21000, @@ -24,12 +27,33 @@ def test_tx(nonce: int): } -def gen(global_seq, num_accounts, num_txs) -> [str]: +def erc20_transfer_tx(nonce: int): + # data is erc20 transfer function call + data = "0xa9059cbb" + eth_abi.encode(["address", "uint256"], [RECIPIENT, 1]).hex() + return { + "to": CONTRACT_ADDRESS, + "value": 0, + "nonce": nonce, + "gas": 51630, + "gasPrice": GAS_PRICE, + "chainId": CHAIN_ID, + "data": data, + } + + +TX_TYPES = { + "simple-transfer": simple_transfer_tx, + "erc20-transfer": erc20_transfer_tx, +} + + +def gen(global_seq, num_accounts, num_txs, tx_type: str) -> [str]: accounts = [gen_account(global_seq, i + 1) for i in range(num_accounts)] txs = [] + create_tx = TX_TYPES[tx_type] for i in range(num_txs): for acct in accounts: - txs.append(acct.sign_transaction(test_tx(i)).rawTransaction.hex()) + txs.append(acct.sign_transaction(create_tx(i)).rawTransaction.hex()) if len(txs) % 1000 == 0: print("generated", len(txs), "txs for node", global_seq) diff --git a/testground/benchmark/benchmark/utils.py b/testground/benchmark/benchmark/utils.py index 6cbab687a6..42a6947176 100644 --- a/testground/benchmark/benchmark/utils.py +++ b/testground/benchmark/benchmark/utils.py @@ -31,9 +31,27 @@ def patch_toml(path: Path, patch): return doc -def patch_json(path: Path, patch): +_merger = jsonmerge.Merger( + { + "properties": { + "app_state": { + "properties": { + "auth": {"properties": {"accounts": {"mergeStrategy": "append"}}}, + "evm": {"properties": {"accounts": {"mergeStrategy": "append"}}}, + } + } + } + } +) + + +def merge_genesis(base, head): + return _merger.merge(base, head) + + +def patch_genesis(path: Path, patch): doc = json.loads(path.read_text()) - doc = jsonmerge.merge(doc, patch) + doc = merge_genesis(doc, patch) path.write_text(json.dumps(doc)) return doc diff --git a/testground/benchmark/flake.nix b/testground/benchmark/flake.nix index f71ff46a46..f29572553a 100644 --- a/testground/benchmark/flake.nix +++ b/testground/benchmark/flake.nix @@ -10,47 +10,7 @@ }; outputs = { self, nixpkgs, flake-utils, poetry2nix }: - let - overrides = { lib, poetry2nix }: poetry2nix.overrides.withDefaults - (self: super: - let - buildSystems = { - pystarport = [ "poetry-core" ]; - durations = [ "setuptools" ]; - multitail2 = [ "setuptools" ]; - docker = [ "hatchling" "hatch-vcs" ]; - pyunormalize = [ "setuptools" ]; - }; - in - lib.mapAttrs - (attr: systems: super.${attr}.overridePythonAttrs - (old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems; - })) - buildSystems - ); - - src = nix-gitignore: nix-gitignore.gitignoreSourcePure [ - "/*" # ignore all, then add whitelists - "!/benchmark/" - "!poetry.lock" - "!pyproject.toml" - ] ./.; - - benchmark = { lib, poetry2nix, python311, nix-gitignore }: poetry2nix.mkPoetryApplication { - projectDir = src nix-gitignore; - python = python311; - overrides = overrides { inherit lib poetry2nix; }; - }; - - benchmark-env = { lib, poetry2nix, python311, nix-gitignore }: poetry2nix.mkPoetryEnv { - projectDir = src nix-gitignore; - python = python311; - overrides = overrides { inherit lib poetry2nix; }; - }; - - in - (flake-utils.lib.eachDefaultSystem + flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { @@ -78,6 +38,5 @@ buildInputs = [ pkgs.benchmark-testcase-env ]; }; legacyPackages = pkgs; - }) - ); + }); } diff --git a/testground/benchmark/overlay.nix b/testground/benchmark/overlay.nix index 328d6ce9f0..280f3b46cb 100644 --- a/testground/benchmark/overlay.nix +++ b/testground/benchmark/overlay.nix @@ -9,6 +9,7 @@ let multitail2 = [ "setuptools" ]; docker = [ "hatchling" "hatch-vcs" ]; pyunormalize = [ "setuptools" ]; + pytest-github-actions-annotate-failures = [ "setuptools" ]; }; in lib.mapAttrs diff --git a/testground/benchmark/poetry.lock b/testground/benchmark/poetry.lock index 97de198f91..1de23c0eff 100644 --- a/testground/benchmark/poetry.lock +++ b/testground/benchmark/poetry.lock @@ -1489,6 +1489,20 @@ pluggy = ">=1.5,<2.0" [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-github-actions-annotate-failures" +version = "0.2.0" +description = "pytest plugin to annotate failed tests with a workflow command for GitHub Actions" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-github-actions-annotate-failures-0.2.0.tar.gz", hash = "sha256:844ab626d389496e44f960b42f0a72cce29ae06d363426d17ea9ae1b4bef2288"}, + {file = "pytest_github_actions_annotate_failures-0.2.0-py3-none-any.whl", hash = "sha256:8bcef65fed503faaa0524b59cfeccc8995130972dd7b008d64193cc41b9cde85"}, +] + +[package.dependencies] +pytest = ">=4.0.0" + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -2202,4 +2216,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "0fb7ea7cb80f99d281286bd73bc04631c191c6b75b7375fa98cc9e590ff65074" +content-hash = "d3ec463f4fb25df15b04f1f22110475db33719e5e9de2c821b9e4bf2eb857fc5" diff --git a/testground/benchmark/pyproject.toml b/testground/benchmark/pyproject.toml index 132cfc07f3..78f547dabe 100644 --- a/testground/benchmark/pyproject.toml +++ b/testground/benchmark/pyproject.toml @@ -19,8 +19,9 @@ click = "^8.1.7" ujson = "^5.10.0" jsonmerge = "^1.9.2" -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pytest = "^8.2" +pytest-github-actions-annotate-failures = "^0.2.0" [build-system] requires = ["poetry-core"]