Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] gha tests #4893

Closed
wants to merge 142 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
6e2e03a
test parallel tests
AndWeHaveAPlan Jun 27, 2024
2a28fa3
sp_session::MembershipProof
AndWeHaveAPlan Jun 27, 2024
0bacf8d
\
AndWeHaveAPlan Jun 27, 2024
0d0a5e4
nextest filter
AndWeHaveAPlan Jun 27, 2024
3d05b5e
single line
AndWeHaveAPlan Jun 27, 2024
b4f2c73
fl
AndWeHaveAPlan Jun 27, 2024
9a7950c
ls -la
AndWeHaveAPlan Jun 27, 2024
ee25b07
ls
AndWeHaveAPlan Jun 27, 2024
7d968c0
md5sum
AndWeHaveAPlan Jun 27, 2024
e5d568c
find
AndWeHaveAPlan Jun 27, 2024
f1f3d37
log trace
AndWeHaveAPlan Jul 4, 2024
a103f47
LLVM_PROFILE_FILE
AndWeHaveAPlan Jul 4, 2024
9ed20c2
log warn
AndWeHaveAPlan Jul 4, 2024
3f8ef1e
remove ls
AndWeHaveAPlan Jul 5, 2024
6bf73a1
try new forklift
AndWeHaveAPlan Jul 9, 2024
64757cc
download-forklift.sh path
AndWeHaveAPlan Jul 9, 2024
54fc5cf
version check
AndWeHaveAPlan Jul 9, 2024
98f8204
forklift binary
AndWeHaveAPlan Jul 9, 2024
5ebbd9a
ls
AndWeHaveAPlan Jul 9, 2024
ddb94e8
direct download
AndWeHaveAPlan Jul 9, 2024
157104d
chmod
AndWeHaveAPlan Jul 9, 2024
e0d2233
path
AndWeHaveAPlan Jul 9, 2024
d050dbf
timeout
AndWeHaveAPlan Jul 9, 2024
7fa05a5
log trace
AndWeHaveAPlan Jul 10, 2024
502b63e
absolute LLVM_PROFILE_FILE path
AndWeHaveAPlan Jul 10, 2024
9d9d05e
5 jobs
AndWeHaveAPlan Jul 11, 2024
b7a6d1f
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 11, 2024
7226716
no cache
AndWeHaveAPlan Jul 11, 2024
0321353
exclude some tests
AndWeHaveAPlan Jul 12, 2024
4ac9e6d
increase timeout
AndWeHaveAPlan Jul 12, 2024
5fb07cb
exclude more tests
AndWeHaveAPlan Jul 12, 2024
984a5e3
exclude availability_is_recovered_from_chunks_even_if_backing_group_s…
AndWeHaveAPlan Jul 12, 2024
22742a1
exclude more tests + format
AndWeHaveAPlan Jul 12, 2024
c378b7e
reformat
AndWeHaveAPlan Jul 12, 2024
7e26f9f
upload coverage reports job
AndWeHaveAPlan Jul 12, 2024
017c65e
new ci-unified
AndWeHaveAPlan Jul 13, 2024
dc8b71f
docker.io
AndWeHaveAPlan Jul 13, 2024
fdf6bc6
add llvm-tools-preview
AndWeHaveAPlan Jul 13, 2024
03b5fd1
coverage path
AndWeHaveAPlan Jul 13, 2024
4cb7af1
abs path
AndWeHaveAPlan Jul 13, 2024
03a415c
ls
AndWeHaveAPlan Jul 13, 2024
5e83067
rel path for .profraw?
AndWeHaveAPlan Jul 13, 2024
ff75a55
upload path fix
AndWeHaveAPlan Jul 13, 2024
e5ee40e
remove ls
AndWeHaveAPlan Jul 13, 2024
31de451
grcov ignore
AndWeHaveAPlan Jul 13, 2024
a7bd7c6
trigger
AndWeHaveAPlan Jul 13, 2024
de67693
grcov ignore
AndWeHaveAPlan Jul 13, 2024
3a4a18d
grcov ignore
AndWeHaveAPlan Jul 14, 2024
e381a94
try cargo-llvm-cov
AndWeHaveAPlan Jul 17, 2024
3e75e21
ci-unified image update
AndWeHaveAPlan Jul 17, 2024
0192870
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 17, 2024
354d888
LLVM_PROFILE_FILE disable
AndWeHaveAPlan Jul 17, 2024
4251cb6
opts order
AndWeHaveAPlan Jul 17, 2024
6f2c06f
subcommand order
AndWeHaveAPlan Jul 17, 2024
f6f18dc
order
AndWeHaveAPlan Jul 17, 2024
31599d7
nextest args
AndWeHaveAPlan Jul 18, 2024
6edf13c
remove "run"
AndWeHaveAPlan Jul 18, 2024
10e1416
remove double
AndWeHaveAPlan Jul 18, 2024
822629b
try nextest -p
AndWeHaveAPlan Jul 18, 2024
85df09d
yaml fix
AndWeHaveAPlan Jul 19, 2024
d2ab16a
typo
AndWeHaveAPlan Jul 19, 2024
55b88c3
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 19, 2024
61d83c0
group-crates test
AndWeHaveAPlan Jul 19, 2024
0f90f68
python3
AndWeHaveAPlan Jul 19, 2024
d9e892b
&&
AndWeHaveAPlan Jul 19, 2024
403319a
remove llvm-cov leftovers
AndWeHaveAPlan Jul 19, 2024
0827203
7 parts
AndWeHaveAPlan Jul 19, 2024
c8b6924
try nextest filter
AndWeHaveAPlan Jul 19, 2024
95945ee
package -E
AndWeHaveAPlan Jul 19, 2024
baf3006
more packages
AndWeHaveAPlan Jul 19, 2024
fdc9bba
try +package(polkadot)
AndWeHaveAPlan Jul 19, 2024
ef400bd
only polkadot
AndWeHaveAPlan Jul 19, 2024
1152fb6
try asset-hub-rococo-runtime only
AndWeHaveAPlan Jul 19, 2024
222d727
grout-crates out format
AndWeHaveAPlan Jul 19, 2024
5015673
$PACKAGES
AndWeHaveAPlan Jul 19, 2024
82c634c
typo pkg
AndWeHaveAPlan Jul 19, 2024
479e186
grout-crates single line output
AndWeHaveAPlan Jul 19, 2024
9f0050c
filter expression
AndWeHaveAPlan Jul 19, 2024
ad8a019
space
AndWeHaveAPlan Jul 19, 2024
3d7fd27
expression format
AndWeHaveAPlan Jul 19, 2024
3e05ca1
less packages per job
AndWeHaveAPlan Jul 19, 2024
7f7efa4
20 groups try
AndWeHaveAPlan Jul 20, 2024
a8b3217
package(polkadot) only test
AndWeHaveAPlan Jul 20, 2024
cd0ffa9
grcov args try
AndWeHaveAPlan Jul 20, 2024
a8b9239
no workspace
AndWeHaveAPlan Jul 20, 2024
6c905d9
features
AndWeHaveAPlan Jul 20, 2024
376886c
multiple packages test
AndWeHaveAPlan Jul 20, 2024
6e35056
packages
AndWeHaveAPlan Jul 20, 2024
01f6f41
multiple jobs
AndWeHaveAPlan Jul 20, 2024
137e9ef
group-crates fix
AndWeHaveAPlan Jul 20, 2024
0669fc9
remove ,experimental,riscv
AndWeHaveAPlan Jul 20, 2024
8277e72
codecov upload
AndWeHaveAPlan Jul 20, 2024
ba79480
tree features
AndWeHaveAPlan Jul 21, 2024
7ff9ba1
typo
AndWeHaveAPlan Jul 21, 2024
03b3aa9
script output
AndWeHaveAPlan Jul 21, 2024
4eb7950
features
AndWeHaveAPlan Jul 21, 2024
3aec7b3
llvm-profdata
AndWeHaveAPlan Jul 21, 2024
bf6cdd0
expression
AndWeHaveAPlan Jul 21, 2024
6cff40c
trigger
AndWeHaveAPlan Jul 21, 2024
8834c0b
trigger
AndWeHaveAPlan Jul 21, 2024
84f6cde
grcov target/release/deps/
AndWeHaveAPlan Jul 21, 2024
422756b
--bins --lib
AndWeHaveAPlan Jul 22, 2024
a950a94
remove workspace
AndWeHaveAPlan Jul 22, 2024
ff20ef4
llvm-profdata test again
AndWeHaveAPlan Jul 22, 2024
3ef102e
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 22, 2024
bd581d3
all
AndWeHaveAPlan Jul 22, 2024
4859dfb
llcm-cov
AndWeHaveAPlan Jul 23, 2024
8f540e6
- test(/chain-spec-guide-runtime::chain_spec_builder_tests/)
AndWeHaveAPlan Jul 23, 2024
cc4024c
filter fix
AndWeHaveAPlan Jul 23, 2024
727975b
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 23, 2024
f41b4b8
chain_spec_builder_tests regex
AndWeHaveAPlan Jul 23, 2024
3f0963e
--filter-expr
AndWeHaveAPlan Jul 23, 2024
347ad25
-generate_chain_spec
AndWeHaveAPlan Jul 23, 2024
f14c54f
- chain_spec_builder_tests
AndWeHaveAPlan Jul 23, 2024
d96397a
-p polkadot
AndWeHaveAPlan Jul 23, 2024
28eb755
release
AndWeHaveAPlan Jul 24, 2024
6f6c9c7
release
AndWeHaveAPlan Jul 24, 2024
2043bc3
ls target
AndWeHaveAPlan Jul 24, 2024
cbab666
ls llvm-cov-target
AndWeHaveAPlan Jul 24, 2024
031e994
--release --codecov
AndWeHaveAPlan Jul 24, 2024
4e89cc8
--workspace
AndWeHaveAPlan Jul 24, 2024
6f5931b
build args
AndWeHaveAPlan Jul 24, 2024
d74eab9
partition
AndWeHaveAPlan Jul 24, 2024
b24c769
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 24, 2024
5812f5b
chain-spec-guide-runtime::chain_spec_builder_tests
AndWeHaveAPlan Jul 24, 2024
bb133f4
presets tests
AndWeHaveAPlan Jul 24, 2024
43550f3
--lcov report
AndWeHaveAPlan Jul 25, 2024
61ee433
upload test
AndWeHaveAPlan Jul 25, 2024
1ac9cf5
features
AndWeHaveAPlan Jul 25, 2024
c372b7c
remove features
AndWeHaveAPlan Jul 25, 2024
26b4795
codecov root_dir
AndWeHaveAPlan Jul 25, 2024
16bcd65
all
AndWeHaveAPlan Jul 25, 2024
a50ab82
report --codecov
AndWeHaveAPlan Jul 25, 2024
0340b0f
- tests::receive_rate_limit_is_enforced
AndWeHaveAPlan Jul 25, 2024
70f6d64
- polkadot-availability-recovery
AndWeHaveAPlan Jul 25, 2024
ff39eae
codecov v4
AndWeHaveAPlan Jul 28, 2024
3ba22c4
Merge branch 'master' into es/coverage-gha
AndWeHaveAPlan Jul 28, 2024
065de67
codecov path "fixes"
AndWeHaveAPlan Jul 28, 2024
79fa819
more "fixes"
AndWeHaveAPlan Jul 29, 2024
45d8a8c
try forklift
AndWeHaveAPlan Jul 31, 2024
a99a51b
download-forklift path fix
AndWeHaveAPlan Jul 31, 2024
072a338
log trace
AndWeHaveAPlan Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .forklift/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ compressionLevel = 3
[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
logLevel = "trace"
threadsCount = 6

[cache]
Expand Down
5 changes: 4 additions & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ coverage:
project:
default:
target: 1.0
threshold: 2.0
threshold: 2.0

fixes:
- "/__w/polkadot-sdk/polkadot-sdk/::"
2 changes: 1 addition & 1 deletion .github/env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v202407161507"
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v202407161507"
48 changes: 48 additions & 0 deletions .github/scripts/group-crates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import subprocess, sys

# Get all crates
output = subprocess.check_output(["cargo", "tree", "--locked", "--workspace", "--depth", "0", "--prefix", "none", "--features", "try-runtime,ci-only-tests,experimental,riscv"])

# Convert the output into a proper list
crates = []
for line in output.splitlines():
if line != b"":
line = line.decode('utf8').split(" ")
crate_name = line[0]
# The crate path is always the last element in the line.
crate_path = line[len(line) - 1].replace("(", "").replace(")", "")
crates.append(crate_name)

# Make the list unique and sorted
crates = list(set(crates))
crates.sort()

#print(f'total crates: {len(crates)}')

#
current_group = int(sys.argv[1]) - 1
total_groups = int(sys.argv[2])

cratesPerGroup = len(crates) // total_groups

if current_group >= total_groups:
print("`current group` is greater than `total groups`")
sys.exit(1)

#print(f'group {current_group+1}/{total_groups}, {cratesPerGroup} crates per group')

#
start = cratesPerGroup * current_group
end = cratesPerGroup * (current_group + 1)

if current_group + 1 == total_groups:
end = len(crates)

#
part = crates[start : end]

result = 'package('+part[0]+')'
for pkg in part[1:]:
result += ' + package('+pkg+')'

print(result)
89 changes: 89 additions & 0 deletions .github/workflows/tests-linux-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,92 @@ jobs:
uses: actions/checkout@v4
- name: script
run: time forklift cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet

#
test-linux-stable:
needs: [set-image, changes]
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 120
container:
image: ${{ needs.set-image.outputs.IMAGE }}
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings -Cinstrument-coverage"
#LLVM_PROFILE_FILE: "target/coverage/cargo-test-${{ matrix.ci_node_index }}-%p-%m.profraw"
LLVM_PROFILE_FILE: "/__w/polkadot-sdk/polkadot-sdk/target/coverage/cargo-test-${{ matrix.ci_node_index }}-%p-%m.profraw"
strategy:
fail-fast: false
matrix:
ci_node_total: [5]
ci_node_index: [1, 2, 3, 4, 5]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: update forklift
run: /builds/download-forklift.sh -v master -p ./forklift/
- run: forklift version

- run: rustup component add llvm-tools-preview
- run: cargo install cargo-llvm-cov

- run: mkdir -p target/coverage/result
- name: script
run: >
time forklift cargo llvm-cov nextest
--no-report --release
--workspace
--locked --no-fail-fast
--features try-runtime,ci-only-tests,experimental,riscv
--filter-expr "
!test(/.*benchmark.*/)
- test(/recovers_from_only_chunks_if_pov_large::case_1/)
- test(/participation_requests_reprioritized_for_newly_included/)
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_1/)
- test(/rejects_missing_inherent_digest/)
- test(/availability_is_recovered_from_chunks_even_if_backing_group_supplied_if_chunks_only::case_1/)
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_2/)
- test(/all_security_features_work/)
- test(/nonexistent_cache_dir/)
- test(/recovers_from_only_chunks_if_pov_large::case_3/)
- test(/recovers_from_only_chunks_if_pov_large::case_2/)
- test(/authoring_blocks/)
- test(/rejects_missing_seals/)
- test(/generate_chain_spec/)
- test(/get_preset/)
- test(/list_presets/)
- test(/tests::receive_rate_limit_is_enforced/)
- test(/polkadot-availability-recovery/)
"
--partition count:${{ matrix.ci_node_index }}/${{ matrix.ci_node_total }}
- run: ls -al target/coverage
- run: ls -al /__w/polkadot-sdk/polkadot-sdk/target
- run: ls -al /__w/polkadot-sdk/polkadot-sdk/target/llvm-cov-target
- name: generate report
run: cargo llvm-cov report --release --codecov --output-path coverage-${{ matrix.ci_node_index }}.lcov
- run: ls -al
- name: upload report
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.ci_node_index }}.lcov
path: coverage-${{ matrix.ci_node_index }}.lcov
#
upload-reports:
needs: [test-linux-stable]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: reports
pattern: coverage-report-*
merge-multiple: true
- run: ls -al reports/
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
directory: reports
root_dir: /__w/polkadot-sdk/polkadot-sdk/
1 change: 1 addition & 0 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ test-linux-stable:
reports:
junit: target/nextest/default/junit.xml
timeout: 90m
when: manual

test-linux-oldkernel-stable:
extends: test-linux-stable
Expand Down
7 changes: 3 additions & 4 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,7 @@ impl pallet_babe::Config for Runtime {
type WeightInfo = ();
type MaxAuthorities = MaxAuthorities;
type MaxNominators = MaxNominators;
type KeyOwnerProof =
<Historical as KeyOwnerProofSystem<(KeyTypeId, pallet_babe::AuthorityId)>>::Proof;
type KeyOwnerProof = sp_session::MembershipProof;
type EquivocationReportSystem =
pallet_babe::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}
Expand Down Expand Up @@ -1487,7 +1486,7 @@ impl pallet_grandpa::Config for Runtime {
type MaxAuthorities = MaxAuthorities;
type MaxNominators = MaxNominators;
type MaxSetIdSessionEntries = MaxSetIdSessionEntries;
type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
type KeyOwnerProof = sp_session::MembershipProof;
type EquivocationReportSystem =
pallet_grandpa::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}
Expand Down Expand Up @@ -2548,7 +2547,7 @@ impl pallet_beefy::Config for Runtime {
type OnNewValidatorSet = MmrLeaf;
type AncestryHelper = MmrLeaf;
type WeightInfo = ();
type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, BeefyId)>>::Proof;
type KeyOwnerProof = sp_session::MembershipProof;
type EquivocationReportSystem =
pallet_beefy::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}
Expand Down
6 changes: 3 additions & 3 deletions substrate/frame/babe/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ use frame_election_provider_support::{
};
use frame_support::{
derive_impl, parameter_types,
traits::{ConstU128, ConstU32, ConstU64, KeyOwnerProofSystem, OnInitialize},
traits::{ConstU128, ConstU32, ConstU64, OnInitialize},
};
use pallet_session::historical as pallet_session_historical;
use sp_consensus_babe::{AuthorityId, AuthorityPair, Randomness, Slot, VrfSignature};
use sp_core::{
crypto::{KeyTypeId, Pair, VrfSecret},
crypto::{Pair, VrfSecret},
U256,
};
use sp_io;
Expand Down Expand Up @@ -182,7 +182,7 @@ impl Config for Test {
type WeightInfo = ();
type MaxAuthorities = ConstU32<10>;
type MaxNominators = ConstU32<100>;
type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, AuthorityId)>>::Proof;
type KeyOwnerProof = sp_session::MembershipProof;
type EquivocationReportSystem =
super::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}
Expand Down
6 changes: 3 additions & 3 deletions substrate/frame/grandpa/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ use frame_election_provider_support::{
};
use frame_support::{
derive_impl, parameter_types,
traits::{ConstU128, ConstU32, ConstU64, KeyOwnerProofSystem, OnFinalize, OnInitialize},
traits::{ConstU128, ConstU32, ConstU64, OnFinalize, OnInitialize},
};
use pallet_session::historical as pallet_session_historical;
use sp_consensus_grandpa::{RoundNumber, SetId, GRANDPA_ENGINE_ID};
use sp_core::{crypto::KeyTypeId, H256};
use sp_core::{H256};
use sp_keyring::Ed25519Keyring;
use sp_runtime::{
curve::PiecewiseLinear,
Expand Down Expand Up @@ -186,7 +186,7 @@ impl Config for Test {
type MaxAuthorities = ConstU32<100>;
type MaxNominators = ConstU32<1000>;
type MaxSetIdSessionEntries = MaxSetIdSessionEntries;
type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, AuthorityId)>>::Proof;
type KeyOwnerProof = sp_session::MembershipProof;
type EquivocationReportSystem =
super::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}
Expand Down
Loading