Skip to content
Snippets Groups Projects
Commit 62a49be9 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Resolve "E2E tests fail but the CI succeeds" (nodes/rust/duniter-v2s!189)

* fix(#132): fix: always run `tests` job by default

* fix(#132): fix: change `tests` job

* fix(#132): E2E tests must fail if some hooks have failed
parent dcfd6c75
No related branches found
No related tags found
1 merge request!189Resolve "E2E tests fail but the CI succeeds"
Pipeline #34096 waiting for manual action
...@@ -127,20 +127,26 @@ build_release_tag: ...@@ -127,20 +127,26 @@ build_release_tag:
IMAGE_TAG: "$CI_COMMIT_TAG" IMAGE_TAG: "$CI_COMMIT_TAG"
PODMAN_BUILD_OPTIONS: "--platform linux/amd64" PODMAN_BUILD_OPTIONS: "--platform linux/amd64"
test_debug: tests:
stage: tests stage: tests
extends: .docker_build image: rust:1-bullseye
rules: rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/ - if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual when: manual
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
when: never when: never
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"' - if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual when: manual
- when: always
variables: variables:
IMAGE_NAME: "duniter/duniter-v2s-test" DEBIAN_FRONTEND: noninteractive
IMAGE_TAG: "debug-sha-$CI_COMMIT_SHORT_SHA" script:
PODMAN_BUILD_OPTIONS: "--target build --build-arg debug=1 --build-arg cucumber=1" - apt-get update
- apt-get install -y clang cmake protobuf-compiler
# cargo build is required for cucumber tests anyway
- cargo build
- cargo tu
- cargo cucumber
test_release: test_release:
stage: tests stage: tests
......
...@@ -18,7 +18,7 @@ mod common; ...@@ -18,7 +18,7 @@ mod common;
use async_trait::async_trait; use async_trait::async_trait;
use common::*; use common::*;
use cucumber::{given, then, when, World, WorldInit}; use cucumber::{given, then, when, FailureWriter, World, WorldInit};
use sp_keyring::AccountKeyring; use sp_keyring::AccountKeyring;
use std::convert::Infallible; use std::convert::Infallible;
use std::path::PathBuf; use std::path::PathBuf;
...@@ -636,7 +636,7 @@ async fn main() { ...@@ -636,7 +636,7 @@ async fn main() {
}) })
.expect("Error setting Ctrl-C handler"); .expect("Error setting Ctrl-C handler");
DuniterWorld::cucumber() let summarize = DuniterWorld::cucumber()
//.fail_on_skipped() //.fail_on_skipped()
.max_concurrent_scenarios(4) .max_concurrent_scenarios(4)
.before(|feature, _rule, scenario, world| { .before(|feature, _rule, scenario, world| {
...@@ -660,8 +660,12 @@ async fn main() { ...@@ -660,8 +660,12 @@ async fn main() {
Box::pin(std::future::ready(())) Box::pin(std::future::ready(()))
}) })
.with_cli(opts) .with_cli(opts)
.run_and_exit(features_path) .run(features_path)
.await; .await;
if summarize.hook_errors() > 0 {
panic!("Could not run tests correctly (hook errors)");
}
} }
fn genesis_conf_name(feature_tags: &[String], scenario_tags: &[String]) -> String { fn genesis_conf_name(feature_tags: &[String], scenario_tags: &[String]) -> String {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment