Невозможно запустить Junit 5 с огурцом на кодовой строительстве AWSJAVA

Программисты JAVA общаются здесь
Anonymous
Невозможно запустить Junit 5 с огурцом на кодовой строительстве AWS

Сообщение Anonymous »

Я нахожусь в процессе преобразования моего хранилища Java Maven с JUNIT 4 в JUNIT 5. После обновления моих методов, бегуна и POM я могу запускать тесты на местном уровне в IntelliJ, но при запуске их на кодовой строительстве AWS тесты не выполняются. Я использую огурец вместе с этим.package com.eacautomation;

import io.cucumber.junit.platform.engine.Constants;
import org.junit.platform.suite.api.*;

@Suite(failIfNoTests = false)
@IncludeEngines("cucumber")
@SelectClasspathResource("FeatureFiles")
@SelectPackages("com.eacautomation")
@ConfigurationParameter(key = Constants.GLUE_PROPERTY_NAME, value = "com.eacautomation.stepDefinitions")
@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "pretty")
@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "junit:target/TEST-com.eacautomation.apiDefinition.RunCukesTest.xml")
@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "html:target/cucumber-report/cucumber.html")
@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "json:target/cucumber-report/cucumber.json")

public class RunTests {
}
< /code>
pom.xml


4.0.0
com.eacautomation
com.eacautomation
1.0-SNAPSHOT
com.eacautomation
com.eacautomation


1.12.788
1.19.0
3.18.0
7.28.0
0.2.7
1.0.6
7.28.1
5.1.2
1.14.0
34.0.0
1.0.6
1.5.0
2.13.1
33.4.8-jre
1.3
2.0.8
5.5
2.20
2.20.0
4.0.2
1.0.2
4.0.5
2.6.0
2.9.0
1.1.1
20250517
5.13.4
1.13.4
0.8.1
2.25.1
3.7.1
3.5.0
21
21
3.13.0
5.9.0
3.11.2
3.6.0
4.0.0-M16
3.5.3
4.2.5.Final
4.12.0
5.4.1
5.0.0
5.5.5
4.34.0
4.34.0
0.5




com.amazonaws
aws-java-sdk
${aws.java.sdk.version}



commons-codec
commons-codec
${commons.codec.version}



org.apache.commons
commons-lang3
${commons.lang3.version}


io.cucumber
cucumber-core
${cucumber.version}


io.cucumber
cucumber-java
${cucumber.version}


io.cucumber
cucumber-junit
${cucumber.version}



io.cucumber
cucumber-junit-platform-engine
${cucumber.version}
test



io.cucumber
cucumber-picocontainer
${cucumber.picocontainer.version}



com.aventstack
extentreports
${extentreports.version}



tech.grasshopper
extentreports-cucumber7-adapter
${extentreports.cucumber7.adapter.version}



io.cucumber
gherkin
${gherkin.version}


com.warrenstrange
googleauth
${googleauth.version}



org.apache.httpcomponents.client5
httpclient5
${httpclient.version}



com.fasterxml.jackson.core
jackson-annotations
${jackson.version}



com.fasterxml.jackson.core
jackson-core
${jackson.core.version}



com.fasterxml.jackson.core
jackson-databind
${jackson.core.version}



jakarta.xml.bind
jakarta.xml.bind-api
${jakarta.xml.bind.version}


com.github.javafaker
javafaker
${javafaker.version}



net.minidev
json-smart
${json.smart.version}



org.glassfish.jaxb
jaxb-runtime
${jaxb.runtime.version}



com.jayway.jsonpath
json-path
${json.path.version}



com.jayway.jsonpath
json-path-assert
${json.path.version}
test


org.junit.jupiter
junit-jupiter-api
${junit.jupiter.version}
test



org.junit.jupiter
junit-jupiter-engine
${junit.jupiter.version}
test



org.junit.platform
junit-platform-commons
${junit.platform.version}



org.junit.platform
junit-platform-console
${junit.platform.version}



org.junit.platform
junit-platform-engine
${junit.platform.version}
test



org.junit.platform
junit-platform-launcher
${junit.platform.version}
test



org.junit.platform
junit-platform-runner
${junit.platform.version}
test



org.junit.platform
junit-platform-suite-api
${junit.platform.version}
test



org.junit.platform
junit-platform-suite-engine
${junit.platform.version}
test



org.junit.vintage
junit-vintage-engine
${junit.jupiter.version}
test



io.cucumber
junit-xml-formatter
${junit.xml.formatter.version}


org.apache.logging.log4j
log4j-api
${log4j.version}



org.apache.logging.log4j
log4j-core
${log4j.version}



org.apache.logging.log4j
log4j-jpl
${log4j.version}
runtime



com.squareup.okhttp3
logging-interceptor
${okhttp.version}


org.apache.maven.plugins
maven-assembly-plugin
${maven.assembly.plugin.version}


net.masterthought
maven-cucumber-reporting
${maven.cucumber.reporting.version}



org.apache.maven.plugins
maven-failsafe-plugin
${maven.surefire.plugin.version}


org.apache.maven.plugins
maven-surefire-plugin
${maven.surefire.plugin.version}
maven-plugin



io.netty
netty-codec
${netty.codec.version}



io.netty
netty-codec-http
${netty.codec.version}



com.squareup.okhttp3
okhttp
${okhttp.version}



org.apache.poi
poi-ooxml
${poi.ooxml.version}



de.monochromata.cucumber
reporting-plugin
${reporting.plugin.version}


io.rest-assured
rest-assured
${restassured.version}



org.iq80.snappy
snappy
${snappy.version}





repo.bodar.com
https://repo.bodar.com






org.apache.maven.plugins
maven-compiler-plugin
${maven.compiler.plugin.version}

${maven.compiler.source}
${maven.compiler.target}
UTF-8

-parameters




net.masterthought
maven-cucumber-reporting
${maven.cucumber.reporting.version}


execution
verify

generate


analysis-ui-test
${project.build.directory}/cucumber-html-reports






org.apache.maven.plugins
maven-surefire-report-plugin
${maven.surefire.plugin.version}


org.apache.maven.plugins
maven-site-plugin
${maven.site.plugin.version}

${project.build.directory}/surefire-report



org.apache.maven.plugins
maven-surefire-plugin
${maven.surefire.plugin.version}


org.junit.jupiter
junit-jupiter
${junit.jupiter.version}




**/RunTests.java


${project.build.directory}








1








org.apache.maven.plugins
maven-surefire-report-plugin
${maven.surefire.plugin.version}





< /code>
И это файл buildspec.yml, который я использую для запуска на AWS Codebuild: < /p>
version: 0.2

phases:
install:
runtime-versions:
java: corretto21
commands:
- echo Install started on `date`
- java --version
build:
commands:
- echo Build started on `date`
- mvn $STAGING_CREDENTIALS -Dcucumber.filter.tags="@Regression" -Dsurefire.rerunFailingTestsCount=1 test
post_build:
commands:
- echo Build completed on `date`
- mvn surefire-report:report-only
reports:
arn:aws:codebuild:eu-west-2:161668806093:report-group/eac-staging-daily-test-reportGroupCucumberJson:
files:
- 'TEST-com.eacautomation.apiDefinition.RunCukesTest.xml'
base-directory: 'target'
discard-paths: yes
artifacts:
files:
- '**/*'
cache:
paths:
- '/root/.m2/**/*'
< /code>
При запуске на AWS Codebuild это ответ: < /p>
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
2025-09-10T12:59:37.517165138Z main INFO Starting configuration XmlConfiguration[location=/codebuild/output/src1681936737/src/git-codecommit.eu-west-2.amazonaws.com/v1/repos/eacautomation/target/test-classes/log4j2.xml, lastModified=2025-09-10T12:59:29.481Z]...
2025-09-10T12:59:37.519017025Z main INFO Configuration XmlConfiguration[location=/codebuild/output/src1681936737/src/git-codecommit.eu-west-2.amazonaws.com/v1/repos/eacautomation/target/test-classes/log4j2.xml, lastModified=2025-09-10T12:59:29.481Z] started.
2025-09-10T12:59:37.521663977Z main INFO Stopping configuration org.apache.logging.log4j.core.config.DefaultConfiguration@783a467b...
2025-09-10T12:59:37.522152207Z main INFO Configuration org.apache.logging.log4j.core.config.DefaultConfiguration@783a467b stopped.
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:44 min
[INFO] Finished at: 2025-09-10T12:59:37Z
[INFO] ------------------------------------------------------------------------

[Container] 2025/09/10 12:59:37.586760 Phase complete: BUILD State: SUCCEEDED


Подробнее здесь: https://stackoverflow.com/questions/797 ... -codebuild

Вернуться в «JAVA»