Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit a23b596

Browse files
author
Oleg Plakida
committed
Test flaky
1 parent 38e5122 commit a23b596

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

.config/nextest.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dir = "target/nextest"
1616
# * retries = 3
1717
# * retries = { backoff = "fixed", count = 2, delay = "1s" }
1818
# * retries = { backoff = "exponential", count = 10, delay = "1s", jitter = true, max-delay = "10s" }
19-
retries = 0
19+
retries = 5
2020

2121
# The number of threads to run tests with. Supported values are either an integer or
2222
# the string "num-cpus". Can be overridden through the `--test-threads` option.
@@ -94,7 +94,7 @@ path = "junit.xml"
9494
# The name of the top-level "report" element in JUnit report. If aggregating
9595
# reports across different test runs, it may be useful to provide separate names
9696
# for each report.
97-
report-name = "nextest-run"
97+
report-name = "substrate"
9898

9999
# Whether standard output and standard error for passing tests should be stored in the JUnit report.
100100
# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frame/support/test/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ sp-std = { version = "5.0.0", default-features = false, path = "../../../primiti
2626
sp-version = { version = "5.0.0", default-features = false, path = "../../../primitives/version" }
2727
trybuild = { version = "1.0.74", features = [ "diff" ] }
2828
pretty_assertions = "1.2.1"
29+
rand = "0.8.5"
2930
rustversion = "1.0.6"
3031
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" }
3132
# The "std" feature for this pallet is never activated on purpose, in order to test construct_runtime error message

frame/support/test/tests/benchmark_ui.rs

+4-14
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,12 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18+
use rand::Rng;
19+
1820
#[rustversion::attr(not(stable), ignore)]
1921
#[cfg(not(feature = "disable-ui-tests"))]
2022
#[test]
2123
fn benchmark_ui() {
22-
// Only run the ui tests when `RUN_UI_TESTS` is set.
23-
if std::env::var("RUN_UI_TESTS").is_err() {
24-
return
25-
}
26-
27-
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
28-
std::env::set_var("SKIP_WASM_BUILD", "1");
29-
30-
// Deny all warnings since we emit warnings as part of a Pallet's UI.
31-
std::env::set_var("RUSTFLAGS", "--deny warnings");
32-
33-
let t = trybuild::TestCases::new();
34-
t.compile_fail("tests/benchmark_ui/*.rs");
35-
t.pass("tests/benchmark_ui/pass/*.rs");
24+
let mut rng = rand::thread_rng();
25+
assert_eq!(rng.gen_range(0..6), 0);
3626
}

scripts/ci/gitlab/pipeline/test.yml

+16
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,22 @@ test-linux-stable:
234234
reports:
235235
junit: target/nextest/default/junit.xml
236236

237+
test-linux-stable-upload-test-results:
238+
stage: test
239+
needs:
240+
- job: test-linux-stable
241+
artifacts: true
242+
extends:
243+
- .docker-env
244+
- .test-refs
245+
script:
246+
- cat target/nextest/default/junit.xml | xq . > target/nextest/default/junit.json
247+
- curl -v -XPOST --http1.1
248+
-u ${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}
249+
https://elasticsearch.parity-build.parity.io/unit-tests/_doc/
250+
-H 'Content-Type: application/json'
251+
-d @target/nextest/default/junit.json
252+
237253
test-frame-support:
238254
stage: test
239255
extends:

0 commit comments

Comments
 (0)