jenkinsci / archetypes

Collection of Maven archetypes to get developers started
64 stars 47 forks source link

Unit test HelloWorldBuilderTest.testScriptedPipeline() doesn't work. #679

Closed KaueMoura closed 10 months ago

KaueMoura commented 10 months ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux Ubuntu 18.04.6 LTS

Reproduction steps

  1. Create a new jenkins plugin project using archetype hello-world
  2. Run unit test method testScriptedPipeline() in the HelloWorldBuilderTest class.

Expected Results

Test executed successfully

Actual Results

java.lang.AssertionError: unexpected build status; build log was:

Started [Pipeline] Start of Pipeline [Pipeline] node Running on Jenkins in /tmp/j h7924288827949760219/workspace/test-scripted-pipeline [Pipeline] { [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: cf7b083d-1dfd-456e-b0e9-d24a96e58bb2 java.lang.NoSuchMethodError: No such DSL method 'greet' found among steps [archive, bat, catchError, checkout, deleteDir, dir, echo, envVarsForTool, error, fileExists, getContext, input, isUnix, library, libraryResource, load, mail, node, parallel, powershell, properties, pwd, pwsh, readFile, readTrusted, resolveScm, retry, script, sh, sleep, stage, stash, step, timeout, tool, unarchive, unstable, unstash, validateDeclarativePipeline, waitUntil, warnError, withContext, withCredentials, withEnv, wrap, writeFile, ws] or symbols [agent, all, allBranchesSame, allOf, always, any, anyOf, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, branch, buildButton, buildDiscarder, buildDiscarders, buildRetention, buildingTag, builtInNode, caseInsensitive, caseSensitive, certificate, changeRequest, changelog, changeset, checkoutToSubdirectory, choice, choiceParam, clock, command, credentials, cron, crumb, defaultDisplayUrlProvider, defaultFolderConfiguration, defaultView, demand, disableConcurrentBuilds, disableRestartFromStage, disableResume, downstream, dumb, durabilityHint, envVars, envVarsFilter, environment, equals, experimentalFlags, expression, file, fileParam, filePath, fingerprint, fingerprints, frameOptions, freeStyle, freeStyleJob, fromScm, fromSource, git, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, inbound, installSource, isRestartedRun, jdk, jgit, jgitapache, jnlp, jobBuildDiscarder, jobName, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM, list, local, location, logRotator, loggedInUsersCanDoAnything, mailer, masterBuild, maven, maven3Mojos, mavenErrors, mavenGlobalConfig, mavenMojos, mavenWarnings, modernSCM, multiBranchProjectDisplayNaming, multibranch, myView, namedBranchesDifferent, node, nodeProperties, none, nonresumable, not, organizationFolder, overrideIndexTriggers, paneStatus, parallelsAlwaysFailFast, parameters, password, pattern, permanent, pipeline, pipelineTriggers, plainText, plugin, pollSCM, preserveStashes, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, rateLimit, rateLimitBuilds, resourceRoot, retainOnlyVariables, run, runParam, schedule, scmRetryCount, scriptApproval, scriptApprovalLink, search, security, shell, simpleBuildDiscarder, skipDefaultCheckout, skipStagesAfterUnstable, slave, sourceRegexFilter, sourceWildcardFilter, sshUserPrivateKey, standard, status, string, stringParam, suppressAutomaticTriggering, suppressFolderAutomaticTriggering, swapSpace, tag, text, textParam, timezone, tmpSpace, toolLocation, triggeredBy, unsecured, untrusted, upstream, userSeed, usernameColonPassword, usernamePassword, viewsTabBar, weather, zip] or globals [currentBuild, env, params, pipeline, scm] at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:219) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:180) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:163) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:178) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:182) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:152) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) at org.jenkinsci.plugins.workflow.cps.LoggingInvoker.methodCall(LoggingInvoker.java:105) at WorkflowScript.run(WorkflowScript:1) at cps.transform(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:90) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:116) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:83) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:152) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:146) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:146) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:422) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:97) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Finished: FAILURE


Expected: is but: was at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1502) at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1508) at org.jvnet.hudson.test.JenkinsRule.assertBuildStatusSuccess(JenkinsRule.java:1536) at com.nttdata.camaleo.jenkins.plugin.HelloWorldBuilderTest.testScriptedPipeline(HelloWorldBuilderTest.java:75) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:655) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.lang.Thread.run(Thread.java:829)

Anything else?

No response

Are you interested in contributing a fix?

No response

MarkEWaite commented 10 months ago

I'm unable to duplicate the problem based on your description. Can you provide more details about your environment?

I ran my test on Linux Ubuntu 22.04, since Linux Ubuntu 18.04.6 LTS is no longer publicly supported by Canonical and is no longer supported by the Jenkins project.

Steps that I used:

$ mvn -version
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: /home/mwaite/tools/apache-maven-3.9.5
Java version: 17.0.9, vendor: Eclipse Adoptium, runtime: /opt/jdk-17
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.5.0-4-amd64", arch: "amd64", family: "unix"

I chose option 4 for the hello-world and was able to build successfully with mvn clean verify.

Here is the typescript session:

mwaite@testing-b:~/tmp$ mvn archetype:generate -Dfilter=io.jenkins.archetypes:mvn archetype:generate -Dfilter=io.jenkins.archetypes:
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] >>> archetype:3.2.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO] 
[INFO] <<< archetype:3.2.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO] 
[INFO] 
[INFO] --- archetype:3.2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -> io.jenkins.archetypes:empty-plugin (Skeleton of a Jenkins plugin with a POM and an empty source tree.)
2: remote -> io.jenkins.archetypes:global-configuration-plugin (Skeleton of a Jenkins plugin with a POM and an example piece of global configuration.)
3: remote -> io.jenkins.archetypes:global-shared-library (Uses the Jenkins Pipeline Unit mock library to test the usage of a Global Shared Library)
4: remote -> io.jenkins.archetypes:hello-world-plugin (Skeleton of a Jenkins plugin with a POM and an example build step.)
5: remote -> io.jenkins.archetypes:scripted-pipeline (Uses the Jenkins Pipeline Unit mock library to test the logic inside a Pipeline script.)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 4
Choose io.jenkins.archetypes:hello-world-plugin version: 
1: 1.1
2: 1.2
3: 1.3
4: 1.4
5: 1.5
6: 1.6
7: 1.7
8: 1.8
9: 1.9
10: 1.10
11: 1.11
12: 1.12
13: 1.13
14: 1.14
15: 1.15
16: 1.16
17: 1.17
18: 1.19
19: 1.20
20: 1.21
Choose a number: 20: 20
[INFO] Using property: groupId = unused
[INFO] Using property: package = io.jenkins.plugins.sample
[INFO] Using property: hostOnJenkinsGitHub = true
Define value for property 'artifactId': greet-the--world
Define value for property 'version' 1.0-SNAPSHOT: : 
Confirm properties configuration:
groupId: unused
package: io.jenkins.plugins.sample
hostOnJenkinsGitHub: true
artifactId: greet-the-world
version: 1.0-SNAPSHOT
 Y: : n
Define value for property 'groupId' unused: : io.jenkins.plugins.hello
Define value for property 'package' io.jenkins.plugins.sample: : 
Define value for property 'hostOnJenkinsGitHub' (should match expression '(true|false)') true: : 
Define value for property 'artifactId': he. llo-world
Define value for property 'version' 1.0-SNAPSHOT: : 
Confirm properties configuration:
groupId: io.jenkins.plugins.hello
package: io.jenkins.plugins.sample
hostOnJenkinsGitHub: true
artifactId: hello-world
version: 1.0-SNAPSHOT
 Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: hello-world-plugin:1.21
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: io.jenkins.plugins.hello
[INFO] Parameter: artifactId, Value: hello-world
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: io.jenkins.plugins.sample
[INFO] Parameter: packageInPathFormat, Value: io/jenkins/plugins/sample
[INFO] Parameter: package, Value: io.jenkins.plugins.sample
[INFO] Parameter: hostOnJenkinsGitHub, Value: true
[INFO] Parameter: groupId, Value: io.jenkins.plugins.hello
[INFO] Parameter: artifactId, Value: hello-world
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[WARNING] Don't override file /home/mwaite/tmp/hello-world
[WARNING] Don't override file /home/mwaite/tmp/hello-world/src/main/resources/io/jenkins/plugins/sample
[WARNING] Don't override file /home/mwaite/tmp/hello-world/src/main/java/io/jenkins/plugins/sample
[WARNING] Don't override file /home/mwaite/tmp/hello-world/src/test/java/io/jenkins/plugins/sample
[INFO] Executing META-INF/archetype-post-generate.groovy post-generation script
[package:io.jenkins.plugins.sample, hostOnJenkinsGitHub:true, groupId:io.jenkins.plugins.hello, artifactId:hello-world, version:1.0-SNAPSHOT]
[INFO] Project created from Archetype in dir: /home/mwaite/tmp/hello-world
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:09 min
[INFO] Finished at: 2023-11-24T13:37:24-07:00
[INFO] ------------------------------------------------------------------------
mwaite@testing-b:~/tmp$ cd hello-world/
mwaite@testing-b:~/tmp/hello-world$ mvn clean verify
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< io.jenkins.plugins:hello-world >-------------------
[INFO] Building TODO Plugin 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ hpi ]---------------------------------
[INFO] 
[INFO] --- clean:3.3.1:clean (default-clean) @ hello-world ---
[INFO] 
[INFO] --- hpi:3.48:validate (default-validate) @ hello-world ---
[INFO] 
[INFO] --- hpi:3.48:validate-hpi (default-validate-hpi) @ hello-world ---
[INFO] 
[INFO] --- enforcer:3.4.0:enforce (display-info) @ hello-world ---
[INFO] Rule 0: io.jenkins.tools.incrementals.enforcer.RequireExtensionVersion passed
[INFO] Rule 1: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed
[INFO] Rule 2: org.apache.maven.enforcer.rules.version.RequireJavaVersion passed
[INFO] Rule 3: org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion passed
[INFO] Rule 4: org.apache.maven.enforcer.rules.dependency.BannedDependencies passed
[INFO] Rule 5: org.apache.maven.enforcer.rules.dependency.RequireUpperBoundDeps passed
[INFO] 
[INFO] --- enforcer:3.4.0:enforce (no-snapshots-in-release) @ hello-world ---
[INFO] Rule 0: org.apache.maven.enforcer.rules.dependency.RequireReleaseDeps passed
[INFO] 
[INFO] --- localizer:1.31:generate (default) @ hello-world ---
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ hello-world ---
[INFO] Copying 38 resources from src/main/resources to target/classes
[INFO] 
[INFO] --- flatten:1.5.0:flatten (flatten) @ hello-world ---
[INFO] Generating flattened POM of project io.jenkins.plugins:hello-world:hpi:1.0-SNAPSHOT...
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ hello-world ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 2 source files with javac [debug release 11] to target/classes
[INFO] io.jenkins.plugins.sample.HelloWorldBuilder.DescriptorImpl indexed under hudson.Extension
[INFO] 
[INFO] --- access-modifier-checker:1.32:enforce (default-enforce) @ hello-world ---
[INFO] 
[INFO] --- hpi:3.48:insert-test (default-insert-test) @ hello-world ---
[INFO] 
[INFO] --- antrun:3.1.0:run (createTempDir) @ hello-world ---
[INFO] Executing tasks
[INFO]     [mkdir] Created dir: /home/mwaite/tmp/hello-world/target/tmp
[INFO] Executed tasks
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ hello-world ---
[INFO] skip non existing resourceDirectory /home/mwaite/tmp/hello-world/src/test/resources
[INFO] 
[INFO] --- compiler:3.11.0:testCompile (default-testCompile) @ hello-world ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 2 source files with javac [debug release 11] to target/test-classes
[INFO] 
[INFO] --- hpi:3.48:test-hpl (default-test-hpl) @ hello-world ---
[INFO] Generating /home/mwaite/tmp/hello-world/target/test-classes/the.hpl
[INFO] 
[INFO] --- hpi:3.48:resolve-test-dependencies (default-resolve-test-dependencies) @ hello-world ---
[INFO] 
[INFO] --- hpi:3.48:test-runtime (default-test-runtime) @ hello-world ---
[INFO] Setting jenkins.addOpens to --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.desktop/com.sun.beans.introspect=ALL-UNNAMED
[INFO] Setting jenkins.insaneHook to --patch-module='java.base=/home/mwaite/tmp/hello-world/target/patch-modules/org-netbeans-insane-hook.jar' --add-exports=java.base/org.netbeans.insane.hook=ALL-UNNAMED
[INFO] 
[INFO] --- surefire:3.1.2:test (default-test) @ hello-world ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
Running tests for io.jenkins.plugins:hello-world:1.0-SNAPSHOT
[INFO] Running io.jenkins.plugins.sample.HelloWorldBuilderTest
[INFO] Running InjectedTest
[INFO] Tests run: 23, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.874 s -- in InjectedTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.10 s -- in io.jenkins.plugins.sample.HelloWorldBuilderTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 28, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- license:104.v2171757ee6dd:process (default) @ hello-world ---
[INFO] Generated /home/mwaite/tmp/hello-world/target/hello-world/WEB-INF/licenses.xml
[INFO] 
[INFO] --- hpi:3.48:hpi (default-hpi) @ hello-world ---
[INFO] Generating /home/mwaite/tmp/hello-world/target/hello-world/META-INF/MANIFEST.MF
[INFO] Checking for attached .jar artifact ...
[INFO] Generating jar /home/mwaite/tmp/hello-world/target/hello-world.jar
[INFO] Building jar: /home/mwaite/tmp/hello-world/target/hello-world.jar
[INFO] Exploding webapp...
[INFO] Copy webapp webResources to /home/mwaite/tmp/hello-world/target/hello-world
[INFO] Assembling webapp hello-world in /home/mwaite/tmp/hello-world/target/hello-world
[INFO] Generating hpi /home/mwaite/tmp/hello-world/target/hello-world.hpi
[INFO] Building jar: /home/mwaite/tmp/hello-world/target/hello-world.hpi
[INFO] 
[INFO] --- jar:3.3.0:test-jar (maybe-test-jar) @ hello-world ---
[INFO] Skipping packaging of the test-jar
[INFO] 
[INFO] >>> spotbugs:4.7.3.5:check (spotbugs) > :spotbugs @ hello-world >>>
[INFO] 
[INFO] --- spotbugs:4.7.3.5:spotbugs (spotbugs) @ hello-world ---
[INFO] Fork Value is true
[INFO] Done SpotBugs Analysis....
[INFO] 
[INFO] <<< spotbugs:4.7.3.5:check (spotbugs) < :spotbugs @ hello-world <<<
[INFO] 
[INFO] 
[INFO] --- spotbugs:4.7.3.5:check (spotbugs) @ hello-world ---
[INFO] BugInstance size is 0
[INFO] Error size is 0
[INFO] No errors/warnings found
[INFO] 
[INFO] --- spotless:2.39.0:check (default) @ hello-world ---
[INFO] Index file does not exist. Fallback to an empty index
[INFO] Spotless.Java is keeping 2 files clean - 0 needs changes to be clean, 2 were already clean, 0 were skipped because caching determined they were already clean
[INFO] Sorting file /tmp/pom16764621425252544868.xml
[INFO] Pom file is already sorted, exiting
[INFO] Spotless.Pom is keeping 1 files clean - 0 needs changes to be clean, 1 were already clean, 0 were skipped because caching determined they were already clean
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  42.809 s
[INFO] Finished at: 2023-11-24T13:38:21-07:00
[INFO] ------------------------------------------------------------------------
KaueMoura commented 10 months ago

I kept trying and discovered something. When I start the application running hpi:run -Dport=5000 and after I run the test it works. But if I turn off the application the tests simply fail. I really wanted to develop some tests. Is there anything I can send you to help?

MarkEWaite commented 10 months ago

I really wanted to develop some tests. Is there anything I can send you to help?

If you provide enough details so that others can duplicate the failure, you'll probably discover the root cause of the failure. I can't duplicate the failure on a supported operating system (Ubuntu 22.,04) with a recent Java 17 release in my development environment. Something is different between your development environment and mine. One of those differences is probably at the root of the problem.

"How to report an issue" identifies many of the questions to answer in your environment.

KaueMoura commented 10 months ago

Hi Mark,

I keep trying to run tests and I discovered something. When I execute the same command that you "mvn clen verify", all tests are executed successfully. But if I try to run just one test method, an error occurs.

Is it possible to run test for only one method? If so, is there a specific command?

Thank you for your help and time.

MarkEWaite commented 10 months ago

Is it possible to run test for only one method? If so, is there a specific command?

mvn clean -Dtest=HelloWorldBuilderTest#testScriptedPipeline verify

KaueMoura commented 10 months ago

Mark, everything is working now. I was using the mvn clean -Dtest=HelloWorldBuilderTest#testScriptedPipeline test command. But now using verify I can run tests for just one method.

i'm so grateful. Thank you.