Spring boot application build pass on gitlab-ci, even if there are test failures

I have TAF created on behalf of Spring Boot. With the following runner:

@SpringBootApplication(proxyBeanMethods = false)
public class SpringBootApplicationTests implements CommandLineRunner {

    public static final String STEP_DEFS = "com.project.package.stepdefs";

    private static final String[] DEFAUL_CUCUMBER_OPTIONS = new String[] {
            "-p", "io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm",
            "-g", STEP_DEFS
    };

    public static void main(String[] args) {
        System.setProperty("allure.results.directory", "target/reports/allure-results");
        SpringApplication.run(SpringBootApplicationTests.class, args);
    }
    @Override
    public void run(String... args) {
        Main.run(ArrayUtils.addAll(DEFAUL_CUCUMBER_OPTIONS, args));
    }

}

in gitlab-ci there is code to run TAF. It creates jar file and runs tests via jar.

 script:
    - mvn clean package spring-boot: repackage -Dspring.profile.active=test1
    - java -Dspring.profile.active=test1 -Dspring.cloud.vault.app-role.secret-id=${SPRING_CLOUD_VAULT_APP_ROLE_SECRET_ID} -Dcucumber.filter.tags="${TAG} and not @issue" -jar target/vcms-at-1.0-SNAPSHOT.jar classpath:features --threads 1

As a result, after running script I am having the following output:

Failed scenarios:
classpath:features/ContractBasic.feature:30 # Add a label in Draft contract
classpath:features/GenerateCoverLetterAndPdf.feature:29 # Check generated Cover letter
24 Scenarios (2 failed, 22 passed)
1023 Steps (2 failed, 41 skipped, 980 passed)
24m8.422s

From the perspective of build:

2023-02-22 07:39:49.205 DEBUG 22 --- [           main] o.s.b.a.ApplicationAvailabilityBean      : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2023-02-22 07:39:49.206 DEBUG 22 --- [extShutdownHook] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@7a67e3c6, started on Wed Feb 22 07:15:37 UTC 2023
2023-02-22 07:39:49.207 DEBUG 22 --- [extShutdownHook] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase -2147483647
2023-02-22 07:39:49.207 DEBUG 22 --- [extShutdownHook] o.s.c.support.DefaultLifecycleProcessor  : Bean 'springBootLoggingLifecycle' completed its stop procedure
2023-02-22 07:39:49.208 DEBUG 22 --- [extShutdownHook] o.s.web.client.RestTemplate              : HTTP POST https://vault.service.consul.epm-sec.projects.epam.com:8200/v1/auth/token/revoke-self
2023-02-22 07:39:49.208 DEBUG 22 --- [extShutdownHook] o.s.web.client.RestTemplate              : Accept=[application/json, application/*+json]
2023-02-22 07:39:49.477 DEBUG 22 --- [extShutdownHook] o.s.web.client.RestTemplate              : Response 204 NO_CONTENT
2023-02-22 07:39:49.478 DEBUG 22 --- [extShutdownHook] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService
Saving cache for successful job
00:00
Creating cache test-main-protected...
WARNING: .m2/repository/: no matching files. Ensure that the artifact path is relative to the working directory 
Archive is up to date!                             
Created cache
Uploading artifacts for successful job
00:03
Uploading artifacts...
 responseStatus=201 Created token=mBqCQdBr
Cleaning up project directory and file based variables
00:00
Job succeeded

As you see tests have failed, but the build is green.
What might be the issue? Please help