Skip to content

Commit 517550c

Browse files
committed
CR changes
1 parent a4ad625 commit 517550c

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: JFrog CLI Security Tests
22

33
on:
44
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
59
# Triggers the workflow on labeled PRs only.
610
pull_request_target:
711
types: [ labeled ]

commands/curation/curationaudit_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,9 @@ func getTestCasesForDoCurationAudit() []testCase {
672672
pathToPreTest: "pretest",
673673
preTestExec: "mvn",
674674
funcToGetGoals: func(t *testing.T) []string {
675-
// We want to fill the cache with dependencies before the tests to only resolve in the test the blocked package
676-
// Cache dir is determined by the project dir so we need to "fake" the cache dir when we run the pretest build.
677-
// When we run the test we will resolve the blocked package from the same cache dir that was filled in the pretest build.
675+
// We want to populate the cache with dependencies before running the tests, so that during the test only the blocked package needs to be resolved.
676+
// The cache directory is determined by the project directory, so we need to "simulate" the cache directory when running the pretest build.
677+
// During the test, the blocked package will be resolved from the same cache directory that was populated in the pretest build.
678678
cleanUpTestDirChange := testUtils.ChangeWDWithCallback(t, filepath.Join("..", "test"))
679679
curationCache, err := utils.GetCurationCacheFolderByTech(techutils.Maven)
680680
require.NoError(t, err)

tests/utils/integration/test_integrationutils.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"net/http"
77
"os"
8-
"os/exec"
98
"path/filepath"
109
"testing"
1110

@@ -156,10 +155,6 @@ func InitGitTest(t *testing.T) {
156155
if !*configTests.TestGit {
157156
t.Skip(getSkipTestMsg("Git commands integration", "--test.git"))
158157
}
159-
err := exec.Command("npm", "install").Run()
160-
if err != nil {
161-
t.Skipf("Skipping Git commands integration tests. Git is not installed. %s", err.Error())
162-
}
163158
}
164159

165160
func CreateJfrogHomeConfig(t *testing.T, encryptPassword bool) {

tests/utils/test_utils.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
configTests "github.com/jfrog/jfrog-cli-security/tests"
2525
"github.com/stretchr/testify/assert"
2626

27-
// coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests"
2827
"github.com/jfrog/jfrog-client-go/utils/io/fileutils"
2928
"github.com/jfrog/jfrog-client-go/utils/log"
3029
clientTests "github.com/jfrog/jfrog-client-go/utils/tests"
@@ -129,17 +128,17 @@ func CreateTestWatch(t *testing.T, policyName string, watchName, severity xrayUt
129128
}
130129
}
131130

132-
func CreateTestProjectEnvInTempDir(t *testing.T, projectPath string) (string, func()) {
133-
// We are not using coreTests.CreateTempDirWithCallbackAndAssert(t) since the callback fails to remove the temp dir on Windows. (Unknown reason)
134-
// tempDirPath, createTempDirCallback := coreTests.CreateTempDirWithCallbackAndAssert(t)
131+
func CreateTestProjectInTempDir(t *testing.T, projectPath string) (string, func()) {
132+
// TODO: We are not using coreTests.CreateTempDirWithCallbackAndAssert(t) since the callback fails to remove the temp dir on Windows.
133+
// (Unknown reason, should be investigated)
135134
tempDirPath := t.TempDir()
136135
maskedPath := filepath.Join(tempDirPath, filepath.Base(projectPath))
137136
assert.NoError(t, biutils.CopyDir(projectPath, maskedPath, true, nil))
138-
return maskedPath, func(){}
137+
return maskedPath, func() {}
139138
}
140139

141140
func CreateTestProjectEnvAndChdir(t *testing.T, projectPath string) (string, func()) {
142-
tempDirPath, createTempDirCallback := CreateTestProjectEnvInTempDir(t, projectPath)
141+
tempDirPath, createTempDirCallback := CreateTestProjectInTempDir(t, projectPath)
143142
prevWd := ChangeWD(t, tempDirPath)
144143
return tempDirPath, func() {
145144
clientTests.ChangeDirAndAssert(t, prevWd)

0 commit comments

Comments
 (0)