Gradle with TestNg: No tests found - java

I am using gradle project
Project is working fine with junit, but
with TestNg i am getting build fail error with this
Testing started at 9:18 PM ...
9:18:08 PM: Executing tasks ':cleanTest :test --tests "abc.lau" --scan'...
> Task :cleanTest
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [abc.lau](filter.includeTestsMatching)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
3 actionable tasks: 3 executed

did you explicitly specify in build.gradle that you use testng?
test {
useTestNG()
}

Related

How solve app:mergeDexRelease Failed issue?

Logs
Run gradle/gradle-build-action#v2.2.2
Gradle User Home already exists: will not restore from cache.
/home/runner/work/File-Explorer/File-Explorer/gradlew assembleRelease
Welcome to Gradle 7.5!
Here are the highlights of this release:
Support for Java 18
Support for building with Groovy 4
Much more responsive continuous builds
Improved diagnostics for dependency resolution
For more details see https://docs.gradle.org/7.5/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32
This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
Task :build-logic:preBuild UP-TO-DATE
Task :build-logic:preReleaseBuild UP-TO-DATE
Task :kotlinc:preBuild UP-TO-DATE
Task :kotlinc:preReleaseBuild UP-TO-DATE
Task :kotlinc:compileReleaseAidl NO-SOURCE
Task :build-logic:compileReleaseAidl NO-SOURCE
Task :build-logic:mergeReleaseJniLibFolders
Task :build-logic:mergeReleaseNativeLibs NO-SOURCE
Task :build-logic:stripReleaseDebugSymbols NO-SOURCE
Task :kotlinc:packageReleaseRenderscript NO-SOURCE
Task :build-logic:compileReleaseRenderscript NO-SOURCE
Task :build-logic:copyReleaseJniLibsProjectAndLocalJars
Task :build-logic:generateReleaseBuildConfig
Task :build-logic:generateReleaseResValues
Task :build-logic:generateReleaseResources
Task :build-logic:packageReleaseResources
Task :build-logic:parseReleaseLocalResources
Task :kotlinc:compileReleaseRenderscript NO-SOURCE
Task :kotlinc:generateReleaseResValues
Task :kotlinc:generateReleaseResources
Task :kotlinc:packageReleaseResources
Task :kotlinc:parseReleaseLocalResources
Task :build-logic:processReleaseManifest
Task :kotlinc:processReleaseManifest
Task :kotlinc:generateReleaseBuildConfig
Task :kotlinc:javaPreCompileRelease
Task :build-logic:javaPreCompileRelease
Task :build-logic:mergeReleaseShaders
Task :build-logic:compileReleaseShaders NO-SOURCE
Task :build-logic:generateReleaseAssets UP-TO-DATE
Task :build-logic:packageReleaseAssets
Task :build-logic:packageReleaseRenderscript NO-SOURCE
Task :build-logic:prepareLintJarForPublish
Task :build-logic:prepareReleaseArtProfile
Task :kotlinc:generateReleaseRFile
Task :build-logic:processReleaseJavaRes
Task :build-logic:generateReleaseRFile
Task :build-logic:mergeReleaseJavaResource
Task :build-logic:writeReleaseAarMetadata
Task :kotlinc:mergeReleaseJniLibFolders
Task :kotlinc:mergeReleaseNativeLibs NO-SOURCE
Task :kotlinc:stripReleaseDebugSymbols NO-SOURCE
Task :kotlinc:copyReleaseJniLibsProjectAndLocalJars
Task :kotlinc:mergeReleaseShaders
Task :kotlinc:compileReleaseShaders NO-SOURCE
Task :kotlinc:generateReleaseAssets UP-TO-DATE
Task :kotlinc:packageReleaseAssets
Task :kotlinc:prepareLintJarForPublish
Task :kotlinc:prepareReleaseArtProfile
Task :kotlinc:processReleaseJavaRes
Task :kotlinc:writeReleaseAarMetadata
Task :app:buildKotlinToolingMetadata
Task :app:preBuild UP-TO-DATE
Task :app:preReleaseBuild UP-TO-DATE
Task :app:compileReleaseAidl NO-SOURCE
Task :app:compileReleaseRenderscript NO-SOURCE
Task :app:generateReleaseBuildConfig
Task :app:checkReleaseAarMetadata
Task :app:generateReleaseResValues
Task :app:generateReleaseResources
Task :app:mergeReleaseResources
Task :app:mapReleaseSourceSetPaths
Task :app:createReleaseCompatibleScreenManifests
Task :app:extractDeepLinksRelease
Task :build-logic:extractDeepLinksRelease
Task :kotlinc:extractDeepLinksRelease
Task :app:processReleaseMainManifest
Task :app:processReleaseManifest
Task :app:processReleaseManifestForPackage
Task :build-logic:compileReleaseLibraryResources
Task :kotlinc:compileReleaseLibraryResources
Task :app:processReleaseResources
Task :app:javaPreCompileRelease
Task :app:extractProguardFiles
Task :build-logic:bundleLibResRelease
Task :build-logic:writeReleaseLintModelMetadata
Task :kotlinc:writeReleaseLintModelMetadata
Task :app:mergeReleaseJniLibFolders
Task :build-logic:copyReleaseJniLibsProjectOnly
Task :kotlinc:copyReleaseJniLibsProjectOnly
Task :app:mergeReleaseNativeLibs NO-SOURCE
Task :app:stripReleaseDebugSymbols NO-SOURCE
Task :app:extractReleaseNativeSymbolTables NO-SOURCE
Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE
Task :app:checkReleaseDuplicateClasses
Task :kotlinc:compileReleaseKotlin
w: /home/runner/work/File-Explorer/File-Explorer/kotlinc/src/main/java/org/jetbrains/kotlin/cli/jvm/plugins/ServiceLoaderLite.kt: (52, 13): Unsafe use of a nullable receiver of type MutableList
w: /home/runner/work/File-Explorer/File-Explorer/kotlinc/src/main/java/org/jetbrains/kotlin/cli/jvm/plugins/ServiceLoaderLite.kt: (75, 43): 'toLowerCase(): String' is deprecated. Use lowercase() instead.
w: /home/runner/work/File-Explorer/File-Explorer/kotlinc/src/main/java/org/jetbrains/kotlin/utils/PathUtil.kt: (132, 24): Unsafe use of a nullable receiver of type File?
w: /home/runner/work/File-Explorer/File-Explorer/kotlinc/src/main/java/org/jetbrains/kotlin/utils/PathUtil.kt: (132, 24): Type mismatch: inferred type is File? but File was expected
w: /home/runner/work/File-Explorer/File-Explorer/kotlinc/src/main/java/org/jetbrains/kotlin/utils/PathUtil.kt: (145, 34): Unsafe use of a nullable receiver of type File?
w: /home/runner/work/File-Explorer/File-Explorer/kotlinc/src/main/java/org/jetbrains/kotlin/utils/PathUtil.kt: (165, 35): Type mismatch: inferred type is String? but String was expected
Task :app:desugarReleaseFileDependencies
Task :kotlinc:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Task :kotlinc:bundleLibCompileToJarRelease
Task :build-logic:extractReleaseAnnotations
Task :build-logic:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Task :build-logic:mergeReleaseGeneratedProguardFiles
Task :build-logic:mergeReleaseConsumerProguardFiles
Task :build-logic:syncReleaseLibJars
Task :build-logic:bundleReleaseLocalLintAar
Task :kotlinc:extractReleaseAnnotations
Task :kotlinc:mergeReleaseGeneratedProguardFiles
Task :kotlinc:mergeReleaseConsumerProguardFiles
Task :build-logic:bundleLibCompileToJarRelease
Task :app:compileReleaseKotlin NO-SOURCE
Task :kotlinc:mergeReleaseJavaResource
Task :app:compileReleaseJavaWithJavac
Note: [1] Wrote GeneratedAppGlideModule with: []
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Task :kotlinc:syncReleaseLibJars
Task :kotlinc:bundleReleaseLocalLintAar
Task :kotlinc:bundleLibResRelease
Task :kotlinc:bundleLibRuntimeToJarRelease
Task :kotlinc:createFullJarRelease
Task :build-logic:bundleLibRuntimeToJarRelease
Task :app:mergeExtDexRelease
Task :build-logic:createFullJarRelease
Task :build-logic:bundleLibRuntimeToDirRelease
Task :app:lintVitalAnalyzeRelease
Task :app:lintVitalReportRelease
Task :app:lintVitalRelease
Task :kotlinc:bundleLibRuntimeToDirRelease
Task :app:dexBuilderRelease
Task :app:mergeReleaseArtProfile
Task :app:mergeReleaseShaders
Task :app:compileReleaseShaders NO-SOURCE
Task :app:generateReleaseAssets UP-TO-DATE
Task :app:mergeReleaseAssets
Task :app:compressReleaseAssets
Task :app:processReleaseJavaRes NO-SOURCE
Task :app:mergeReleaseJavaResource
Task :app:optimizeReleaseResources
Task :app:collectReleaseDependencies
Task :app:sdkReleaseDependencyData
Task :app:writeReleaseAppMetadata
Task :app:writeReleaseSigningConfigVersions
Task :build-logic:bundleReleaseAar
Task :build-logic:mergeReleaseResources
Task :build-logic:mapReleaseSourceSetPaths
Task :build-logic:verifyReleaseResources
Task :build-logic:assembleRelease
Task :kotlinc:bundleReleaseAar
Task :kotlinc:mergeReleaseResources
Task :kotlinc:mapReleaseSourceSetPaths
Task :kotlinc:verifyReleaseResources
Task :kotlinc:assembleRelease
Task :app:mergeDexRelease FAILED
ERROR:/home/runner/work/File-Explorer/File-Explorer/build-logic/build/.transforms/63709c9a363d9d7c070fd985789aef5f/transformed/release/org/w3c/dom/html/HTMLDOMImplementation.dex: D8: Type org.w3c.dom.html.HTMLDOMImplementation is defined multiple times: /home/runner/work/File-Explorer/File-Explorer/build-logic/build/.transforms/63709c9a363d9d7c070fd985789aef5f/transformed/release/org/w3c/dom/html/HTMLDOMImplementation.dex, /home/runner/work/File-Explorer/File-Explorer/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes7.dex
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Type org.w3c.dom.html.HTMLDOMImplementation is defined multiple times: /home/runner/work/File-Explorer/File-Explorer/build-logic/build/.transforms/63709c9a363d9d7c070fd985789aef5f/transformed/release/org/w3c/dom/html/HTMLDOMImplementation.dex, /home/runner/work/File-Explorer/File-Explorer/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes7.dex
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:859)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:805)
at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:205)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
at org.gradle.internal.Factories$1.create(Factories.java:31)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /home/runner/work/File-Explorer/File-Explorer/build-logic/build/.transforms/63709c9a363d9d7c070fd985789aef5f/transformed/release/org/w3c/dom/html/HTMLDOMImplementation.dex
at Version.fakeStackEntry(Version_3.2.60.java:0)
at com.android.tools.r8.internal.bi.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:68)
at com.android.tools.r8.internal.bi.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:28)
at com.android.tools.r8.internal.bi.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:27)
at com.android.tools.r8.internal.bi.b(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:3)
at com.android.tools.r8.D8.run(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:11)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136)
... 38 more
Caused by: com.android.tools.r8.internal.a: Type org.w3c.dom.html.HTMLDOMImplementation is defined multiple times: /home/runner/work/File-Explorer/File-Explorer/build-logic/build/.transforms/63709c9a363d9d7c070fd985789aef5f/transformed/release/org/w3c/dom/html/HTMLDOMImplementation.dex, /home/runner/work/File-Explorer/File-Explorer/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes7.dex
at com.android.tools.r8.internal.uQ.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:14)
at com.android.tools.r8.internal.uQ.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:22)
at com.android.tools.r8.internal.yK.b(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:7)
at com.android.tools.r8.internal.yK.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:23)
at com.android.tools.r8.internal.yK.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
at com.android.tools.r8.internal.yK.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:6)
at com.android.tools.r8.graph.A2$a.e(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:4)
at com.android.tools.r8.dex.b.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:105)
at com.android.tools.r8.dex.b.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:28)
at com.android.tools.r8.D8.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:26)
at com.android.tools.r8.D8.d(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:593)
at com.android.tools.r8.D8.b(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:1)
at com.android.tools.r8.internal.bi.a(R8_3.2.60_61a204e00a4460bee78ec2913234dc5e1a3a501d9754e757835d117b7e302ba3:24)
... 41 more
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDexRelease'.
A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
There was a failure while executing work items
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Type org.w3c.dom.html.HTMLDOMImplementation is defined multiple times: /home/runner/work/File-Explorer/File-Explorer/build-logic/build/.transforms/63709c9a363d9d7c070fd985789aef5f/transformed/release/org/w3c/dom/html/HTMLDOMImplementation.dex, /home/runner/work/File-Explorer/File-Explorer/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes7.dex
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 13s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5/userguide/command_line_interface.html#sec:command_line_warnings
105 actionable tasks: 105 executed
Error: Gradle build failed: see console output for details
0s
1s
0s
0s
0s

Jenkins Build failing after integration with Selenium tests

Am trying to integrate our Testng Selenium tests into the Jenkins build queue using Build Gradle Test, currently failing with unreachable exception error. Its a freestyle build, with Invoke Gradle Script as the build step. Please find the console output in the below:
Build Gradle file:
**
Build Failure Logs:
**
[Gradle] - Launching build.
[QaAutomationWeb] $ /var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_6.5.1/bin/gradle test
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
Task :compileJava UP-TO-DATE
Task :processResources NO-SOURCE
Task :classes UP-TO-DATE
Task :compileTestJava
Task :processTestResources UP-TO-DATE
Task :testClasses
Task :test
FBMS-Modernization Tests > Regression Tests > com.fbms.test.LoginTest > getDriver FAILED
org.openqa.selenium.remote.UnreachableBrowserException at RemoteWebDriver.java:589
Caused by: org.openqa.selenium.WebDriverException at DriverService.java:165
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException at UrlChecker.java:104
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException at SimpleTimeLimiter.java:143
Caused by: java.util.concurrent.TimeoutException at FutureTask.java:205
5 tests completed, 1 failed, 4 skipped
Task :test FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':test'.
There were failing tests. See the report at: file:///var/jenkins_home/workspace/QaAutomationWeb/build/reports/tests/test/index.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 38s
4 actionable tasks: 2 executed, 2 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE

How to create and integrate getDatabyID in junit

I have code like this
#Test
void showDataById() throws Exception {
Optional<ProductParameterTable> data = service.getByUuid(this.ppr.getProductParameterTableId());
ProductParameterTable pp = new ProductParameterTable();
pp.setProductParameterTableId(data.get().getProductParameterTableId());
when(service.getByUuid(any(String.class))).thenReturn(data);
mockMvc.perform(get("/product/{uuid}", pp.getProductParameterTableId())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$..product_parameter_table_id").value(pp.getProductParameterTableId()));
verify(service, VerificationModeFactory.times(1)).getByUuid(Mockito.any());
reset(service);
}
but when I check in my intellij this code not coverage my controller. before I create this code I have code for insert. that code for insert is coverage. but for this code not coverage. I use gradle 6.7
Task :compileJava UP-TO-DATE
Task :processResources UP-TO-DATE
Task :classes UP-TO-DATE
Task :compileTestJava
Task :processTestResources NO-SOURCE
Task :testClasses
Task :test FAILED
Task :jacocoTestReport SKIPPED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':test'.
No tests found for given includes: jii..controller.product.ProductParameterTableControllerTest
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
4 actionable tasks: 2 executed, 2 up-to-date
so how to fix my problem for this code ?

Can't run my project error in "run" debug file included

am using last version of gluonhq also i try some other versions . my problem is when i try to run the project , if someone know the solve of it note that am using the demo version i got the following msg:
Executing external task 'run'...
:compileJava
:processResources
:classes
:compileDesktopJava UP-TO-DATE
:processDesktopResources UP-TO-DATE
:desktopClasses UP-TO-DATE
:run FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':run'.
Process 'command 'C:\Program Files\Java\jdk1.8.0_121\bin\java.exe'' finished with non-zero exit value -1073740791
The Debug log here

Appium :cucumber FAILED (DuplicateStepDefinitionException)

Previously I was working with calabash and recently jumped on to Appium. I need some help on Appium-CI-Bamboo issue. The Automation scripts were written in Java-Junit using gradle in cucumber format. It's working fine locally but fails on Bamboo server with below error. I have tried installing all the gems on server(MAC) which were available on my local machine(MAC) but couldn't find where the issue is. Did anyone faced this issue and able to solve it, if so could you help me with the solution which could be a great favour please?
Starting a Gradle Daemon (subsequent builds will be faster)
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
:clean UP-TO-DATE
BUILD SUCCESSFUL
Total time: 20.098 secs
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava
:processTestResources
:testClasses
:test
:check
:build
:runTags UP-TO-DATE
:generateReport UP-TO-DATE
Exception in thread "main" cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in com.project.qa.steps.HomeSteps.tap_on_favourites_icon() in file:/Users/admin/bamboo/xml-data/build-dir/PIR-IQDU-JOB1/UITest/build/classes/test/ and com.project.qa.steps.HomeSteps.tap_on_favourites_icon() in file:/Users/admin/bamboo/xml-data/build-dir/PIR-IQDU-JOB1/UITest/build/classes/test/
        at cucumber.runtime.RuntimeGlue.addStepDefinition(RuntimeGlue.java:33)
        at cucumber.runtime.java.JavaBackend.addStepDefinition(JavaBackend.java:151)
        at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:68)
        at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:41)
        at cucumber.runtime.java.JavaBackend.loadGlue(JavaBackend.java:86)
        at cucumber.runtime.Runtime.<init>(Runtime.java:92)
        at cucumber.runtime.Runtime.<init>(Runtime.java:70)
        at cucumber.runtime.Runtime.<init>(Runtime.java:66)
        at cucumber.api.cli.Main.run(Main.java:35)
        at cucumber.api.cli.Main.main(Main.java:18)
:cucumber FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cucumber'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 27.164 secs
Many Thanks in Advance

Categories

Resources