fortify / fcli

fcli is a command-line utility for interacting with various Fortify products
https://fortify.github.io/fcli/
Other
27 stars 16 forks source link

SSC tests connect to SSC even when skipped #513

Closed rsenden closed 1 month ago

rsenden commented 4 months ago

Some functional tests for SSC connect to SSC if SSC connection details are available, even if those tests are supposed to be skipped because they are not included in the ft.run property.

Because of the way the GitHub Function Tests workflow has been set up, this results in SSC requests being executed even when running for example FoD tests.

Currently there are two places where this behavior takes place, as listed in the stack traces below. Basically, we need to avoid running any setup actions or shared field initialization if all tests in a given test class are being skipped.

at com.fortify.cli.ssc.appversion.cli.cmd.SSCAppVersionCreateCommand.createUncommittedAppVersion(SSCAppVersionCreateCommand.java:161)
at com.fortify.cli.ssc.appversion.cli.cmd.SSCAppVersionCreateCommand.getJsonNode(SSCAppVersionCreateCommand.java:81)
at com.fortify.cli.ssc._common.output.cli.cmd.AbstractSSCJsonNodeOutputCommand.getJsonNode(AbstractSSCJsonNodeOutputCommand.java:23)
at com.fortify.cli.common.output.cli.cmd.AbstractOutputCommand.run(AbstractOutputCommand.java:33)
at picocli.CommandLine.executeUserObject(CommandLine.java:2103)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2538)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2530)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2492)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2[350](https://github.com/fortify/fcli/actions/runs/7917245777/job/21612905313#step:5:351))
at picocli.CommandLine$RunLast.execute(CommandLine.java:2494)
at picocli.CommandLine.execute(CommandLine.java:2247)
at com.fortify.cli.app.runner.DefaultFortifyCLIRunner.run(DefaultFortifyCLIRunner.java:49)
at com.fortify.cli.app.FortifyCLI.execute(FortifyCLI.java:38)
at com.fortify.cli.app.FortifyCLI.main(FortifyCLI.java:32)
at com.fortify.cli.ftest._common.Fcli$FcliResult.expectSuccess(Fcli.groovy:148)
at com.fortify.cli.ftest.ssc._common.SSCAppVersionSupplier$SSCAppVersion.create_closure1(SSCAppVersionSupplier.groovy:48)
at groovy.lang.Closure.call(Closure.java:433)
at com.fortify.cli.ftest._common.Fcli.run(Fcli.groovy:45)
at com.fortify.cli.ftest._common.Fcli.run(Fcli.groovy:67)
at com.fortify.cli.ftest.ssc._common.SSCAppVersionSupplier$SSCAppVersion.create(SSCAppVersionSupplier.groovy:45)
at com.fortify.cli.ftest.ssc._common.SSCAppVersionSupplier.getVersion(SSCAppVersionSupplier.groovy:23)
at com.fortify.cli.ftest.ssc.SSCReportSpec.setupSpec(SSCReportSpec.groovy:47)
at com.fortify.cli.ssc.appversion.cli.cmd.SSCAppVersionCreateCommand.createUncommittedAppVersion(SSCAppVersionCreateCommand.java:161)
at com.fortify.cli.ssc.appversion.cli.cmd.SSCAppVersionCreateCommand.getJsonNode(SSCAppVersionCreateCommand.java:81)
at com.fortify.cli.ssc._common.output.cli.cmd.AbstractSSCJsonNodeOutputCommand.getJsonNode(AbstractSSCJsonNodeOutputCommand.java:23)
at com.fortify.cli.common.output.cli.cmd.AbstractOutputCommand.run(AbstractOutputCommand.java:33)
at picocli.CommandLine.executeUserObject(CommandLine.java:[210](https://github.com/fortify/fcli/actions/runs/7917245777/job/21612905313#step:5:211)3)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2538)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2530)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2492)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2350)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2494)
at picocli.CommandLine.execute(CommandLine.java:2247)
at com.fortify.cli.app.runner.DefaultFortifyCLIRunner.run(DefaultFortifyCLIRunner.java:49)
at com.fortify.cli.app.FortifyCLI.execute(FortifyCLI.java:38)
at com.fortify.cli.app.FortifyCLI.main(FortifyCLI.java:32)
at com.fortify.cli.ftest._common.Fcli$FcliResult.expectSuccess(Fcli.groovy:148)
at com.fortify.cli.ftest.ssc._common.SSCAppVersionSupplier$SSCAppVersion.create_closure1(SSCAppVersionSupplier.groovy:48)
at groovy.lang.Closure.call(Closure.java:433)
at com.fortify.cli.ftest._common.Fcli.run(Fcli.groovy:45)
at com.fortify.cli.ftest._common.Fcli.run(Fcli.groovy:67)
at com.fortify.cli.ftest.ssc._common.SSCAppVersionSupplier$SSCAppVersion.create(SSCAppVersionSupplier.groovy:45)
at com.fortify.cli.ftest.ssc._common.SSCAppVersionSupplier.getVersion(SSCAppVersionSupplier.groovy:23)
at com.fortify.cli.ftest.ssc.SSCArtifactUploadSpec.$spock_initializeSharedFields(SSCArtifactUploadSpec.groovy:22)
rsenden commented 1 month ago

This has already been fixed.