Skip to content

Commit

Permalink
Merge branch 'master' into Optimist
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu authored Nov 1, 2024
2 parents e494e5a + 2700dbf commit 1ee6123
Show file tree
Hide file tree
Showing 36 changed files with 4,412 additions and 4,027 deletions.
2 changes: 1 addition & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ workflows:
]
# The umbrella crate uses more features, so we to check those too:
check_umbrella:
- [ $check.0, '--features=serde,experimental,riscv,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
- [ $check.0, '--features=serde,experimental,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
# Same as `check_*`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
Expand Down
26 changes: 13 additions & 13 deletions .github/scripts/cmd/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks,riscv",
"bench_features": "runtime-benchmarks",
"bench_flags": "--flag1 --flag2"
},
{
Expand Down Expand Up @@ -67,7 +67,7 @@ def setUp(self):
self.patcher6 = patch('importlib.util.spec_from_file_location', return_value=MagicMock())
self.patcher7 = patch('importlib.util.module_from_spec', return_value=MagicMock())
self.patcher8 = patch('cmd.generate_prdoc.main', return_value=0)

self.mock_open = self.patcher1.start()
self.mock_json_load = self.patcher2.start()
self.mock_parse_args = self.patcher3.start()
Expand Down Expand Up @@ -101,27 +101,27 @@ def test_bench_command_normal_execution_all_runtimes(self):
clean=False,
image=None
), [])

self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\n", # Output for dev runtime
"pallet_balances\npallet_staking\npallet_something\n", # Output for westend runtime
"pallet_staking\npallet_something\n", # Output for rococo runtime - no pallet here
"pallet_balances\npallet_staking\npallet_something\n", # Output for asset-hub-westend runtime
"./substrate/frame/balances/Cargo.toml\n", # Mock manifest path for dev -> pallet_balances
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
mock_exit.assert_not_called()

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features=runtime-benchmarks"),

call(get_mock_bench_output(
runtime='kitchensink',
pallets='pallet_balances',
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_bench_command_normal_execution(self):
self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\n", # Output for westend runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand All @@ -171,7 +171,7 @@ def test_bench_command_normal_execution(self):
expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
runtime='westend',
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_bench_command_normal_execution_xcm(self):
self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\npallet_xcm_benchmarks::generic\n", # Output for westend runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand All @@ -214,7 +214,7 @@ def test_bench_command_normal_execution_xcm(self):
expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
runtime='westend',
Expand All @@ -241,7 +241,7 @@ def test_bench_command_two_runtimes_two_pallets(self):
"pallet_staking\npallet_balances\n", # Output for westend runtime
"pallet_staking\npallet_balances\n", # Output for rococo runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand Down Expand Up @@ -309,7 +309,7 @@ def test_bench_command_one_dev_runtime(self):

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks"),
# Westend runtime calls
call(get_mock_bench_output(
runtime='kitchensink',
Expand Down Expand Up @@ -429,4 +429,4 @@ def test_prdoc_command(self, mock_system, mock_parse_args):
self.mock_generate_prdoc_main.assert_called_with(mock_parse_args.return_value[0])

if __name__ == '__main__':
unittest.main()
unittest.main()
2 changes: 1 addition & 1 deletion .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks,riscv",
"bench_features": "runtime-benchmarks",
"bench_flags": "--genesis-builder-policy=none --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
"uri": null,
"is_relay": false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-linux-stable-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
--no-report --release
--workspace
--locked --no-fail-fast
--features try-runtime,ci-only-tests,experimental,riscv
--features try-runtime,ci-only-tests,experimental
--filter-expr "
!test(/.*benchmark.*/)
- test(/recovers_from_only_chunks_if_pov_large::case_1/)
Expand Down Expand Up @@ -120,4 +120,4 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: GHA-coverage
labels: GHA-coverage
4 changes: 2 additions & 2 deletions .github/workflows/tests-linux-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
--release \
--no-fail-fast \
--cargo-quiet \
--features try-runtime,experimental,riscv,ci-only-tests \
--features try-runtime,experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
# run runtime-api tests with `enable-staging-api` feature on the 1st node
- name: runtime-api tests
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
--release \
--no-fail-fast \
--cargo-quiet \
--features experimental,riscv,ci-only-tests \
--features experimental,ci-only-tests \
--filter-expr " !test(/all_security_features_work/) - test(/nonexistent_cache_dir/)" \
--partition count:${{ matrix.partition }} \
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions polkadot/node/core/candidate-validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ polkadot-node-subsystem-test-helpers = { workspace = true }
sp-maybe-compressed-blob = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
polkadot-primitives-test-helpers = { workspace = true }
rstest = { workspace = true }
polkadot-primitives = { workspace = true, features = ["test"] }
Loading

0 comments on commit 1ee6123

Please sign in to comment.