Skip to content

Commit

Permalink
fix skip report error
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Jan 7, 2025
1 parent 62a39a4 commit 365c501
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 3 additions & 8 deletions tests/utils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ func ValidateXrayVersion(t *testing.T, minVersion string) {
}
}

func ValidateXscVersion(t *testing.T, minVersion string) {
xscVersion, err := getTestsXscVersion()
if err != nil {
t.Skip(err)
}
err = clientUtils.ValidateMinimumVersion(clientUtils.Xsc, xscVersion.GetVersion(), minVersion)
if err != nil {
func ValidateXscVersion(t *testing.T, xscVersion, minVersion string) {
if err := clientUtils.ValidateMinimumVersion(clientUtils.Xsc, xscVersion, minVersion); err != nil {
t.Skip(err)
}
}
Expand Down Expand Up @@ -99,7 +94,7 @@ func GetTestsXrayVersion() (version.Version, error) {
return *version.NewVersion(xrayVersion), err
}

func getTestsXscVersion() (version.Version, error) {
func getTestsDeprecatedXscVersion() (version.Version, error) {

Check failure on line 97 in tests/utils/test_utils.go

View workflow job for this annotation

GitHub Actions / Static-Check

func `getTestsDeprecatedXscVersion` is unused (unused)
xscVersion, err := configTests.XscAuth.GetVersion()
return *version.NewVersion(xscVersion), err
}
Expand Down
3 changes: 2 additions & 1 deletion xsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import (
)

func TestReportError(t *testing.T) {
xrayVersion, xscVersion, cleanUp := integration.InitXscTest(t, func() { securityTestUtils.ValidateXscVersion(t, xsc.MinXscVersionForErrorReport) })
xrayVersion, xscVersion, cleanUp := integration.InitXscTest(t)
securityTestUtils.ValidateXscVersion(t, xscVersion, xsc.MinXscVersionForErrorReport)
defer cleanUp()
errorToReport := errors.New("THIS IS NOT A REAL ERROR! This Error is posted as part of TestReportError test")
assert.NoError(t, xsc.ReportError(xrayVersion, xscVersion, tests.XscDetails, errorToReport, "cli"))
Expand Down

0 comments on commit 365c501

Please sign in to comment.