Skip to content

Commit

Permalink
chore: Fix functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Jan 22, 2024
1 parent 25c81f3 commit 6bcc6dd
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ private static final void updateFilePermissions(Path p) {
}
}

// TODO Is there a standard Java class for this?
private static final class LazyObject<T> {
private T value = null;
public T get(Supplier<T> supplier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import spock.lang.Stepwise
class ToolBugTrackerUtilitySpec extends FcliBaseSpec {

def "install"() {
def args = "tool bugtracker-utility install -y -v=latest"
def args = "tool bugtracker-utility install -y -v=latest --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ import spock.lang.Requires
import spock.lang.Shared
import spock.lang.Stepwise

@Prefix("tool.config.update") @Stepwise
@Prefix("tool.definitions.update") @Stepwise
class ToolConfigUpdateSpec extends FcliBaseSpec {

def "updateDefault"() {
def args = "tool config update"
def args = "tool definitions update"
when:
def result = Fcli.run(args)
then:
verifyAll(result.stdout) {
size()>0
it[0].replace(' ', '').equals("RemotepathLocalpathAction")
it[0].replace(' ', '').equals("SourceLastupdateAction")
it[1].replace(" ", "").contains("https://github.com/fortify-ps/tool-definitions/raw/main/v1/tool-definitions")
it[1].contains(" UPDATED")
}
Expand All @@ -53,18 +53,21 @@ class ToolConfigUpdateSpec extends FcliBaseSpec {
}
}

/*
// TODO The tool definitions hosted on this URL are no longer valid due to yaml structure changes
def "updateWithUrl"() {
def args = "tool config update --url https://github.com/psmf22/tool-definitions/raw/main/v1/tool-definitions.yaml.zip"
def args = "tool definitions update --source https://github.com/psmf22/tool-definitions/raw/main/v1/tool-definitions.yaml.zip"
when:
def result = Fcli.run(args)
then:
verifyAll(result.stdout) {
size()>0
it[0].replace(' ', '').equals("RemotepathLocalpathAction")
it[0].replace(' ', '').equals("SourceLastupdateAction")
it[1].replace(" ", "").contains("https://github.com/psmf22/tool-definitions/raw/main/v1/tool-definitions")
it[1].contains(" UPDATED")
}
}
*/

def "listVersions2"() {
def args = "tool debricked-cli list"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import spock.lang.Stepwise
class ToolDebrickedSpec extends FcliBaseSpec {

def "install"() {
def args = "tool debricked-cli install -y -v=latest"
def args = "tool debricked-cli install -y -v=latest --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import spock.lang.Stepwise
class ToolFcliSpec extends FcliBaseSpec {

def "install"() {
def args = "tool fcli install -y -v=latest"
def args = "tool fcli install -y -v=latest --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import spock.lang.Stepwise
class ToolFoDUploaderSpec extends FcliBaseSpec {

def "installLatest"() {
def args = "tool fod-uploader install -y -v=latest"
def args = "tool fod-uploader install -y -v=latest --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down Expand Up @@ -65,7 +65,7 @@ class ToolFoDUploaderSpec extends FcliBaseSpec {
}

def "installV5"() {
def args = "tool fod-uploader install -y -v=5"
def args = "tool fod-uploader install -y -v=5 --progress=none"
when:
def result = Fcli.run(args)
then:
Expand All @@ -78,7 +78,7 @@ class ToolFoDUploaderSpec extends FcliBaseSpec {
}

def "installV50"() {
def args = "tool fod-uploader install -y -v=5.0"
def args = "tool fod-uploader install -y -v=5.0 --progress=none"
when:
def result = Fcli.run(args)
then:
Expand All @@ -91,7 +91,7 @@ class ToolFoDUploaderSpec extends FcliBaseSpec {
}

def "installV500"() {
def args = "tool fod-uploader install -y -v=5.0.0"
def args = "tool fod-uploader install -y -v=5.0.0 --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import spock.lang.Stepwise
class ToolScClientSpec extends FcliBaseSpec {

def "install"() {
def args = "tool sc-client install -y -v=latest"
def args = "tool sc-client install -y -v=latest --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import spock.lang.Stepwise
class ToolVulnExporterSpec extends FcliBaseSpec {

def "install"() {
def args = "tool vuln-exporter install -y -v=latest"
def args = "tool vuln-exporter install -y -v=latest --progress=none"
when:
def result = Fcli.run(args)
then:
Expand Down

0 comments on commit 6bcc6dd

Please sign in to comment.