Skip to content

Commit

Permalink
[ci] fix ci not fail when some testcase failed (#3655)
Browse files Browse the repository at this point in the history
* [ci][fix] ci would block when testcase failed

* try fix some tests
  • Loading branch information
jiangying000 authored Aug 15, 2022
1 parent a991c9b commit b2bc097
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion scripts/auto_rerun_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $env:RUST_LOG="OFF"
$env:RUST_BACKTRACE=0
cargo xtest --exclude starcoin-move-prover -j 15 -- --test-threads=10 --color never --format pretty | Tee-Object "$TEST_RESULT_FILE"

$failed_tests=Select-String -Pattern 'test .* \.\.\. FAILED' -Path "./target/debug/test_result.txt" -AllMatches
$failed_tests=Select-String -Pattern 'test .* +\.\.\. FAILED' -Path "./target/debug/test_result.txt" -AllMatches
Write-Host "All failed tests are redirected to file: $TEST_RESULT_FAILED_FILE" -ForegroundColor Green
$failed_tests > "$TEST_RESULT_FAILED_FILE"

Expand Down
2 changes: 1 addition & 1 deletion scripts/auto_rerun_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ulimit -a

#pleanse ensure tow test command's argument is same.
RUST_LOG=OFF RUST_BACKTRACE=0 cargo xtest --exclude starcoin-move-prover -j 15 -- --test-threads=10 --color never --format pretty |tee "$TEST_RESULT_FILE" ||true
grep -e '^test[[:space:]][^[:space:]]*[[:space:]]\.\.\.[[:space:]]FAILED' "$TEST_RESULT_FILE" >"$TEST_RESULT_FAILED_FILE" ||true
grep -e '^test[[:space:]][^[:space:]]*[[:space:]]\+\.\.\.[[:space:]]FAILED' "$TEST_RESULT_FILE" >"$TEST_RESULT_FAILED_FILE" ||true

status=0
IFS=' '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ task 3 'run'. lines 7-7:
}

task 4 'view'. lines 9-9:
key 0x00000000000000000000000000000001::Account::Account {
key 0x1::Account::Account {
authentication_key: f90391c81027f03cdea491ed8b36ffaced26b6df208a9b569e5baf2590eb9b16
withdrawal_capability: copy drop store 0x00000000000000000000000000000001::Option::Option<0x00000000000000000000000000000001::Account::WithdrawCapability> {
withdrawal_capability: copy drop store 0x1::Option::Option<0x1::Account::WithdrawCapability> {
vec: [
store 0x00000000000000000000000000000001::Account::WithdrawCapability {
store 0x1::Account::WithdrawCapability {
account_address: 662ba5a1a1da0f1c70a9762c7eeb7aaf
},
]
}
key_rotation_capability: copy drop store 0x00000000000000000000000000000001::Option::Option<0x00000000000000000000000000000001::Account::KeyRotationCapability> {
key_rotation_capability: copy drop store 0x1::Option::Option<0x1::Account::KeyRotationCapability> {
vec: [
store 0x00000000000000000000000000000001::Account::KeyRotationCapability {
store 0x1::Account::KeyRotationCapability {
account_address: 662ba5a1a1da0f1c70a9762c7eeb7aaf
},
]
}
withdraw_events: store 0x00000000000000000000000000000001::Event::EventHandle<0x00000000000000000000000000000001::Account::WithdrawEvent> {
withdraw_events: store 0x1::Event::EventHandle<0x1::Account::WithdrawEvent> {
counter: 0
guid: 0000000000000000662ba5a1a1da0f1c70a9762c7eeb7aaf
}
deposit_events: store 0x00000000000000000000000000000001::Event::EventHandle<0x00000000000000000000000000000001::Account::DepositEvent> {
deposit_events: store 0x1::Event::EventHandle<0x1::Account::DepositEvent> {
counter: 0
guid: 0100000000000000662ba5a1a1da0f1c70a9762c7eeb7aaf
}
accept_token_events: store 0x00000000000000000000000000000001::Event::EventHandle<0x00000000000000000000000000000001::Account::AcceptTokenEvent> {
accept_token_events: store 0x1::Event::EventHandle<0x1::Account::AcceptTokenEvent> {
counter: 0
guid: 0100000000000000662ba5a1a1da0f1c70a9762c7eeb7aaf
}
Expand Down
28 changes: 14 additions & 14 deletions vm/types/src/unit_tests/access_path_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ fn test_bad_case_from_protest() {
}

proptest! {
//TODO enable this test, when test_bad_case_from_protest is fixed.
#[ignore]
#[test]
fn test_access_path(raw_access_path in any::<AccessPath>()){
let bytes = bcs_ext::to_bytes(&raw_access_path).expect("access_path serialize should ok.");
let access_path = bcs_ext::from_bytes::<AccessPath>(bytes.as_slice()).expect("access_path deserialize should ok.");
prop_assert_eq!(&raw_access_path, &access_path);
let access_path = raw_access_path.to_string();
let access_path = AccessPath::from_str(access_path.as_str()).expect("access_path from str should ok");
prop_assert_eq!(&raw_access_path, &access_path);
let raw_json = serde_json::to_string(&raw_access_path).expect("access_path to json str should ok");
let access_path = serde_json::from_str::<AccessPath>(raw_json.as_str()).expect("access_path from json str should ok");
prop_assert_eq!(&raw_access_path, &access_path);
}
//TODO enable this test, when test_bad_case_from_protest is fixed.
#[ignore]
#[test]
fn test_access_path(raw_access_path in any::<AccessPath>()){
let bytes = bcs_ext::to_bytes(&raw_access_path).expect("access_path serialize should ok.");
let access_path = bcs_ext::from_bytes::<AccessPath>(bytes.as_slice()).expect("access_path deserialize should ok.");
prop_assert_eq!(&raw_access_path, &access_path);
let access_path = raw_access_path.to_string();
let access_path = AccessPath::from_str(access_path.as_str()).expect("access_path from str should ok");
prop_assert_eq!(&raw_access_path, &access_path);
let raw_json = serde_json::to_string(&raw_access_path).expect("access_path to json str should ok");
let access_path = serde_json::from_str::<AccessPath>(raw_json.as_str()).expect("access_path from json str should ok");
prop_assert_eq!(&raw_access_path, &access_path);
}
}

0 comments on commit b2bc097

Please sign in to comment.