Skip to content

Commit 7b58afa

Browse files
authored
Merge pull request #12531 from ethereum/bleeps-ext-test
External test for Bleeps
2 parents 756ae67 + 1af0ce0 commit 7b58afa

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,14 @@ workflows:
14031403
binary_type: native
14041404
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
14051405
nodejs_version: '16'
1406+
- t_ems_ext:
1407+
<<: *workflow_ubuntu2004_static
1408+
name: t_native_test_ext_bleeps
1409+
project: bleeps
1410+
binary_type: native
1411+
# NOTE: Tests crash on nodejs 17: "Error: error:0308010C:digital envelope routines::unsupported"
1412+
nodejs_version: '16'
1413+
resource_class: medium
14061414

14071415
# Windows build and tests
14081416
- b_win: *workflow_trigger_on_tags

test/externalTests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ printTask "Running external tests..."
4545
"$REPO_ROOT/externalTests/trident.sh" "$@"
4646
"$REPO_ROOT/externalTests/euler.sh" "$@"
4747
"$REPO_ROOT/externalTests/yield-liquidator.sh" "$@"
48+
"$REPO_ROOT/externalTests/bleeps.sh" "$@"

test/externalTests/bleeps.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env bash
2+
3+
# ------------------------------------------------------------------------------
4+
# This file is part of solidity.
5+
#
6+
# solidity is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# solidity is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with solidity. If not, see <http://www.gnu.org/licenses/>
18+
#
19+
# (c) 2022 solidity contributors.
20+
#------------------------------------------------------------------------------
21+
22+
set -e
23+
24+
source scripts/common.sh
25+
source test/externalTests/common.sh
26+
27+
verify_input "$@"
28+
BINARY_TYPE="$1"
29+
BINARY_PATH="$2"
30+
31+
function compile_fn { npm run compile; }
32+
function test_fn { npm run test; }
33+
34+
function bleeps_test
35+
{
36+
local repo="https://github.com/wighawag/bleeps"
37+
local ref_type=tag
38+
local ref=bleeps_migrations # TODO: There's a 0.4.19 contract in 'main' that would need patching for the latest compiler.
39+
local config_file="hardhat.config.ts"
40+
local config_var=config
41+
42+
local compile_only_presets=()
43+
local settings_presets=(
44+
"${compile_only_presets[@]}"
45+
#ir-no-optimize # Compilation fails with: "YulException: Variable param_0 is 2 slot(s) too deep inside the stack."
46+
#ir-optimize-evm-only # Compilation fails with: "YulException: Variable param_0 is 2 slot(s) too deep inside the stack."
47+
ir-optimize-evm+yul
48+
#legacy-no-optimize # Compilation fails with: "CompilerError: Stack too deep, try removing local variables."
49+
#legacy-optimize-evm-only # Compilation fails with: "CompilerError: Stack too deep, try removing local variables."
50+
legacy-optimize-evm+yul
51+
)
52+
53+
[[ $SELECTED_PRESETS != "" ]] || SELECTED_PRESETS=$(circleci_select_steps_multiarg "${settings_presets[@]}")
54+
print_presets_or_exit "$SELECTED_PRESETS"
55+
56+
setup_solc "$DIR" "$BINARY_TYPE" "$BINARY_PATH"
57+
download_project "$repo" "$ref_type" "$ref" "$DIR"
58+
59+
pushd "common-lib/"
60+
neutralize_package_json_hooks
61+
npm install
62+
npm run build
63+
popd
64+
65+
pushd "contracts/"
66+
sed -i 's|"bleeps-common": "workspace:\*",|"bleeps-common": "file:../common-lib/",|g' package.json
67+
68+
neutralize_package_lock
69+
neutralize_package_json_hooks
70+
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
71+
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"
72+
npm install npm-run-all
73+
npm install
74+
75+
replace_version_pragmas
76+
77+
for preset in $SELECTED_PRESETS; do
78+
hardhat_run_test "$config_file" "$preset" "${compile_only_presets[*]}" compile_fn test_fn "$config_var"
79+
done
80+
81+
popd
82+
}
83+
84+
external_test Bleeps bleeps_test

0 commit comments

Comments
 (0)