From ef72afd5d82e358c28d7b21e9717f366fc20112c Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Thu, 29 Jan 2026 15:38:40 +0200 Subject: [PATCH 01/14] Fixes for GitHub and GitLab integration tests for scan-repo --- azure_test.go | 18 +++---- bitbucket_server_test.go | 18 +++---- github_test.go | 31 +++++++------ gitlab_test.go | 31 +++++++------ integrationutils.go | 98 +++++++++++++++++++++------------------ utils/consts.go | 3 ++ utils/getconfiguration.go | 9 +++- 7 files changed, 114 insertions(+), 94 deletions(-) diff --git a/azure_test.go b/azure_test.go index 5688eb9b6..cb08711ad 100644 --- a/azure_test.go +++ b/azure_test.go @@ -21,30 +21,26 @@ func buildAzureReposClient(t *testing.T, azureToken string) vcsclient.VcsClient return azureClient } -func buildAzureReposIntegrationTestDetails(t *testing.T, useLocalRepo bool) *IntegrationTestDetails { +func buildAzureReposIntegrationTestDetails(t *testing.T) *IntegrationTestDetails { integrationRepoToken := getIntegrationToken(t, azureIntegrationTokenEnv) - testDetails := NewIntegrationTestDetails(integrationRepoToken, string(utils.AzureRepos), azureGitCloneUrl, "frogbot-test", useLocalRepo) + testDetails := NewIntegrationTestDetails(integrationRepoToken, string(utils.AzureRepos), azureGitCloneUrl, "frogbot-test") testDetails.ApiEndpoint = azureApiEndpoint return testDetails } -func azureReposTestsInit(t *testing.T, useLocalRepo bool) (vcsclient.VcsClient, *IntegrationTestDetails) { - testDetails := buildAzureReposIntegrationTestDetails(t, useLocalRepo) +func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails) { + testDetails := buildAzureReposIntegrationTestDetails(t) azureClient := buildAzureReposClient(t, testDetails.GitToken) return azureClient, testDetails } +// TODO: Fix scan-pr tests once local directory solution is implemented func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { - azureClient, testDetails := azureReposTestsInit(t, false) + azureClient, testDetails := azureReposTestsInit(t) runScanPullRequestCmd(t, azureClient, testDetails) } func TestAzureRepos_ScanRepositoryIntegration(t *testing.T) { - azureClient, testDetails := azureReposTestsInit(t, false) - runScanRepositoryCmd(t, azureClient, testDetails) -} - -func TestAzureRepos_ScanRepositoryWithLocalDirIntegration(t *testing.T) { - azureClient, testDetails := azureReposTestsInit(t, true) + azureClient, testDetails := azureReposTestsInit(t) runScanRepositoryCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index 9dde83703..6290e5ec5 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -27,9 +27,9 @@ func buildBitbucketServerClient(t *testing.T, bitbucketServerToken string) vcscl return bbClient } -func buildBitbucketServerIntegrationTestDetails(t *testing.T, useLocalRepo bool) *IntegrationTestDetails { +func buildBitbucketServerIntegrationTestDetails(t *testing.T) *IntegrationTestDetails { integrationRepoToken := getIntegrationToken(t, bitbucketServerIntegrationTokenEnv) - testDetails := NewIntegrationTestDetails(integrationRepoToken, string(utils.BitbucketServer), bitbucketServerGitCloneUrl, "FROG", useLocalRepo) + testDetails := NewIntegrationTestDetails(integrationRepoToken, string(utils.BitbucketServer), bitbucketServerGitCloneUrl, "FROG") testDetails.ApiEndpoint = bitbucketServerApiEndpoint return testDetails } @@ -54,24 +54,20 @@ func waitForConnection(t *testing.T) { require.NoError(t, retryExecutor.Execute()) } -func bitbucketServerTestsInit(t *testing.T, useLocalRepo bool) (vcsclient.VcsClient, *IntegrationTestDetails) { - testDetails := buildBitbucketServerIntegrationTestDetails(t, useLocalRepo) +func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails) { + testDetails := buildBitbucketServerIntegrationTestDetails(t) bbClient := buildBitbucketServerClient(t, testDetails.GitToken) waitForConnection(t) return bbClient, testDetails } +// TODO: Fix scan-pr tests once local directory solution is implemented func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { - bbClient, testDetails := bitbucketServerTestsInit(t, false) + bbClient, testDetails := bitbucketServerTestsInit(t) runScanPullRequestCmd(t, bbClient, testDetails) } func TestBitbucketServer_ScanRepositoryIntegration(t *testing.T) { - bbClient, testDetails := bitbucketServerTestsInit(t, false) - runScanRepositoryCmd(t, bbClient, testDetails) -} - -func TestBitbucketServer_ScanRepositoryWithLocalDirIntegration(t *testing.T) { - bbClient, testDetails := bitbucketServerTestsInit(t, true) + bbClient, testDetails := bitbucketServerTestsInit(t) runScanRepositoryCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index c66a6eef6..a39298113 100644 --- a/github_test.go +++ b/github_test.go @@ -1,17 +1,20 @@ package main import ( + "os" + "testing" + "github.com/jfrog/frogbot/v2/utils" "github.com/jfrog/froggit-go/vcsclient" "github.com/jfrog/froggit-go/vcsutils" "github.com/stretchr/testify/assert" - "testing" ) const ( //#nosec G101 -- False positive - no hardcoded credentials. - githubIntegrationTokenEnv = "FROGBOT_TESTS_GITHUB_TOKEN" - githubGitCloneUrl = "https://github.com/frogbot-test/integration.git" + githubIntegrationTokenEnv = "FROGBOT_V3_TESTS_GITHUB_TOKEN" + githubGitCloneUrl = "https://github.com/frogbot-e2e-test/frogbot-test.git" + githubRepoOwner = "frogbot-e2e-test" ) func buildGitHubClient(t *testing.T, githubToken string) vcsclient.VcsClient { @@ -20,28 +23,30 @@ func buildGitHubClient(t *testing.T, githubToken string) vcsclient.VcsClient { return githubClient } -func buildGitHubIntegrationTestDetails(t *testing.T, useLocalRepo bool) *IntegrationTestDetails { +func buildGitHubIntegrationTestDetails(t *testing.T) *IntegrationTestDetails { integrationRepoToken := getIntegrationToken(t, githubIntegrationTokenEnv) - return NewIntegrationTestDetails(integrationRepoToken, string(utils.GitHub), githubGitCloneUrl, "frogbot-test", useLocalRepo) + return NewIntegrationTestDetails(integrationRepoToken, string(utils.GitHub), githubGitCloneUrl, githubRepoOwner) } -func githubTestsInit(t *testing.T, useLocalRepo bool) (vcsclient.VcsClient, *IntegrationTestDetails) { - testDetails := buildGitHubIntegrationTestDetails(t, useLocalRepo) +func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails) { + testDetails := buildGitHubIntegrationTestDetails(t) githubClient := buildGitHubClient(t, testDetails.GitToken) return githubClient, testDetails } +// TODO: Fix scan-pr tests once local directory solution is implemented func TestGitHub_ScanPullRequestIntegration(t *testing.T) { - githubClient, testDetails := githubTestsInit(t, false) + githubClient, testDetails := githubTestsInit(t) runScanPullRequestCmd(t, githubClient, testDetails) } +// TODO set a profile without JAS for the test func TestGitHub_ScanRepositoryIntegration(t *testing.T) { - githubClient, testDetails := githubTestsInit(t, false) - runScanRepositoryCmd(t, githubClient, testDetails) -} + assert.NoError(t, os.Setenv(utils.EnableFrogbotV3FixEnv, "true")) + defer func() { + assert.NoError(t, os.Unsetenv(utils.EnableFrogbotV3FixEnv)) + }() -func TestGitHub_ScanRepositoryWithLocalDirIntegration(t *testing.T) { - githubClient, testDetails := githubTestsInit(t, true) + githubClient, testDetails := githubTestsInit(t) runScanRepositoryCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index 2cce4d35f..a492ffe2d 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -1,17 +1,20 @@ package main import ( + "os" + "testing" + "github.com/jfrog/frogbot/v2/utils" "github.com/jfrog/froggit-go/vcsclient" "github.com/jfrog/froggit-go/vcsutils" "github.com/stretchr/testify/assert" - "testing" ) const ( //#nosec G101 -- False positive - no hardcoded credentials. - gitlabIntegrationTokenEnv = "FROGBOT_TESTS_GITLAB_TOKEN" - gitlabGitCloneUrl = "https://gitlab.com/frogbot-test2/integration.git" + gitlabIntegrationTokenEnv = "FROGBOT_V3_TESTS_GITLAB_TOKEN" + gitlabGitCloneUrl = "https://gitlab.com/frogbot-e2e-test1/frogbot-test.git" + gitlabRepoOwner = "frogbot-e2e-test1" ) func buildGitLabClient(t *testing.T, gitlabToken string) vcsclient.VcsClient { @@ -20,28 +23,30 @@ func buildGitLabClient(t *testing.T, gitlabToken string) vcsclient.VcsClient { return azureClient } -func buildGitLabIntegrationTestDetails(t *testing.T, useLocalRepo bool) *IntegrationTestDetails { +func buildGitLabIntegrationTestDetails(t *testing.T) *IntegrationTestDetails { integrationRepoToken := getIntegrationToken(t, gitlabIntegrationTokenEnv) - return NewIntegrationTestDetails(integrationRepoToken, string(utils.GitLab), gitlabGitCloneUrl, "frogbot-test2", useLocalRepo) + return NewIntegrationTestDetails(integrationRepoToken, string(utils.GitLab), gitlabGitCloneUrl, gitlabRepoOwner) } -func gitlabTestsInit(t *testing.T, useLocalRepo bool) (vcsclient.VcsClient, *IntegrationTestDetails) { - testDetails := buildGitLabIntegrationTestDetails(t, useLocalRepo) +func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails) { + testDetails := buildGitLabIntegrationTestDetails(t) gitlabClient := buildGitLabClient(t, testDetails.GitToken) return gitlabClient, testDetails } +// TODO: Fix scan-pr tests once local directory solution is implemented func TestGitLab_ScanPullRequestIntegration(t *testing.T) { - gitlabClient, testDetails := gitlabTestsInit(t, false) + gitlabClient, testDetails := gitlabTestsInit(t) runScanPullRequestCmd(t, gitlabClient, testDetails) } +// TODO set a profile without JAS for the test func TestGitLab_ScanRepositoryIntegration(t *testing.T) { - gitlabClient, testDetails := gitlabTestsInit(t, false) - runScanRepositoryCmd(t, gitlabClient, testDetails) -} + assert.NoError(t, os.Setenv(utils.EnableFrogbotV3FixEnv, "true")) + defer func() { + assert.NoError(t, os.Unsetenv(utils.EnableFrogbotV3FixEnv)) + }() -func TestGitLab_ScanRepositoryWithLocalDirIntegration(t *testing.T) { - gitlabClient, testDetails := gitlabTestsInit(t, true) + gitlabClient, testDetails := gitlabTestsInit(t) runScanRepositoryCmd(t, gitlabClient, testDetails) } diff --git a/integrationutils.go b/integrationutils.go index a9ac65bec..59b923843 100644 --- a/integrationutils.go +++ b/integrationutils.go @@ -23,10 +23,11 @@ import ( ) const ( - repoName = "integration" - issuesBranch = "issues-branch" + repoName = "frogbot-test" + issuesBranch = "issues-branch" // TODO consider changing (without 'frogbot' prefix) mainBranch = "main" - expectedNumberOfIssues = 10 + gitUsername = "frogbot-e2e-test" + expectedNumberOfIssues = 10 // TODO change when fixing PR tests ) type IntegrationTestDetails struct { @@ -40,19 +41,17 @@ type IntegrationTestDetails struct { ApiEndpoint string PullRequestID string CustomBranchName string - UseLocalRepo bool // TODO can remove when deprecating non-local repository concept from integration tests } -func NewIntegrationTestDetails(token, gitProvider, gitCloneUrl, repoOwner string, useLocalRepo bool) *IntegrationTestDetails { +func NewIntegrationTestDetails(token, gitProvider, gitCloneUrl, repoOwner string) *IntegrationTestDetails { return &IntegrationTestDetails{ - GitProject: repoName, - RepoOwner: repoOwner, - RepoName: repoName, - GitToken: token, - GitUsername: "frogbot", - GitProvider: gitProvider, - GitCloneURL: gitCloneUrl, - UseLocalRepo: useLocalRepo, + GitProject: repoName, + RepoOwner: repoOwner, + RepoName: repoName, + GitToken: token, + GitUsername: gitUsername, + GitProvider: gitProvider, + GitCloneURL: gitCloneUrl, } } @@ -131,6 +130,19 @@ func findRelevantPrID(pullRequests []vcsclient.PullRequestInfo, branch string) ( return } +func cleanupLeftoverFrogbotPRs(t *testing.T, client vcsclient.VcsClient, testDetails *IntegrationTestDetails, gitManager *utils.GitManager) { + remainingPRs := getOpenPullRequests(t, client, testDetails) + for _, pr := range remainingPRs { + if strings.HasPrefix(pr.Source.Name, "frogbot-") { + t.Logf("Cleaning up leftover frogbot PR: %s (ID: %d)", pr.Source.Name, pr.ID) + closePullRequest(t, client, testDetails, int(pr.ID)) + if err := gitManager.RemoveRemoteBranch(pr.Source.Name); err != nil { + t.Logf("Warning: failed to remove leftover branch %s: %v", pr.Source.Name, err) + } + } + } +} + func getOpenPullRequests(t *testing.T, client vcsclient.VcsClient, testDetails *IntegrationTestDetails) []vcsclient.PullRequestInfo { ctx := context.Background() pullRequests, err := client.ListOpenPullRequests(ctx, testDetails.RepoOwner, testDetails.RepoName) @@ -181,49 +193,47 @@ func runScanRepositoryCmd(t *testing.T, client vcsclient.VcsClient, testDetails assert.NoError(t, restoreFunc()) }() - // When testing using local repository, clone the repository before the test starts, so we can work with it as if it existed locally - if testDetails.UseLocalRepo { - cloneOptions := &git.CloneOptions{ - URL: testDetails.GitCloneURL, - Auth: &githttp.BasicAuth{ - Username: testDetails.GitUsername, - Password: testDetails.GitToken, - }, - RemoteName: "origin", - ReferenceName: utils.GetFullBranchName("main"), - SingleBranch: true, - Depth: 1, - Tags: git.NoTags, - } - _, err := git.PlainClone(testTempDir, false, cloneOptions) - require.NoError(t, err) + cloneOptions := &git.CloneOptions{ + URL: testDetails.GitCloneURL, + Auth: &githttp.BasicAuth{ + Username: testDetails.GitUsername, + Password: testDetails.GitToken, + }, + RemoteName: "origin", + ReferenceName: utils.GetFullBranchName("main"), + SingleBranch: true, + Depth: 1, + Tags: git.NoTags, } - timestamp := getTimestamp() - // Add a timestamp to the fixing pull requests, to identify them later - testDetails.CustomBranchName = "frogbot-{IMPACTED_PACKAGE}-{BRANCH_NAME_HASH}-" + timestamp + _, err := git.PlainClone(testTempDir, false, cloneOptions) + require.NoError(t, err) // Set the required environment variables for the scan-repository command unsetEnvs := setIntegrationTestEnvs(t, testDetails) defer unsetEnvs() - err := Exec(&scanrepository.ScanRepositoryCmd{}, utils.ScanRepository) + err = Exec(&scanrepository.ScanRepositoryCmd{}, utils.ScanRepository) require.NoError(t, err) gitManager := buildGitManager(t, testDetails) pullRequests := getOpenPullRequests(t, client, testDetails) - expectedBranchName := "frogbot-pyjwt-45ebb5a61916a91ae7c1e3ff7ffb6112-" + timestamp - prId := findRelevantPrID(pullRequests, expectedBranchName) - assert.NotZero(t, prId) - closePullRequest(t, client, testDetails, prId) - assert.NoError(t, gitManager.RemoveRemoteBranch(expectedBranchName)) - - expectedBranchName = "frogbot-pyyaml-985622f4dbf3a64873b6b8440288e005-" + timestamp - prId = findRelevantPrID(pullRequests, expectedBranchName) - assert.NotZero(t, prId) - closePullRequest(t, client, testDetails, prId) - assert.NoError(t, gitManager.RemoveRemoteBranch(expectedBranchName)) + expectedBranches := []string{ + "frogbot-snyk-5aaa88cc32aaaf2d8d893decd0a1b284", + "frogbot-lodash-aa38d67476e2ac9a5f7011b7c2c6728b", + "frogbot-minimist-e6e68f7e53c2b59c6bd946e00af797f7", + } + for _, expectedBranch := range expectedBranches { + prId := findRelevantPrID(pullRequests, expectedBranch) + assert.NotZero(t, prId, "Expected to find PR for branch %s", expectedBranch) + if prId != 0 { + closePullRequest(t, client, testDetails, prId) + assert.NoError(t, gitManager.RemoveRemoteBranch(expectedBranch)) + } + } + + cleanupLeftoverFrogbotPRs(t, client, testDetails, gitManager) } func validateResults(t *testing.T, ctx context.Context, client vcsclient.VcsClient, testDetails *IntegrationTestDetails, prID int) { diff --git a/utils/consts.go b/utils/consts.go index f124f9e1a..58e512e19 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -8,6 +8,9 @@ type vcsProvider string type ciProvider string const ( + // TODO delete this env var and its usages when we re-enable fixes for all package manager + EnableFrogbotV3FixEnv = "JF_ENABLE_FROGBOT_V3_FIX" + // MaxConcurrentScanners represents the maximum number of threads for running JFrog CLI scanners concurrently MaxConcurrentScanners = 5 diff --git a/utils/getconfiguration.go b/utils/getconfiguration.go index 978545284..592744c8d 100644 --- a/utils/getconfiguration.go +++ b/utils/getconfiguration.go @@ -511,7 +511,12 @@ func getConfigurationProfile(xrayVersion string, jfrogServer *coreconfig.ServerD } log.Info(fmt.Sprintf("Using Config profile '%s'", configProfile.ProfileName)) - // TODO: Remove this line once autofix logic is added - configProfile.FrogbotConfig.CreateAutoFixPr = false + // TODO: Remove this block once autofix logic is added + enableFix, err := getBoolEnv(EnableFrogbotV3FixEnv, false) + if !enableFix { + configProfile.FrogbotConfig.CreateAutoFixPr = false + } else { + log.Info("Currently, Frogbot V3 fixing process is disabled by default. To enable fixing functionality, please set the 'JF_ENABLE_FROGBOT_V3_FIX' environment variable to 'true'.") + } return } From 0d43ddc90b6338b99668aa7fa34c9e481ec90318 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Thu, 29 Jan 2026 16:10:59 +0200 Subject: [PATCH 02/14] adding skip for pr-tests --- azure_test.go | 1 + bitbucket_server_test.go | 1 + github_test.go | 1 + gitlab_test.go | 1 + 4 files changed, 4 insertions(+) diff --git a/azure_test.go b/azure_test.go index cb08711ad..4df469e10 100644 --- a/azure_test.go +++ b/azure_test.go @@ -36,6 +36,7 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet // TODO: Fix scan-pr tests once local directory solution is implemented func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") azureClient, testDetails := azureReposTestsInit(t) runScanPullRequestCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index 6290e5ec5..e00ba81cf 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -63,6 +63,7 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe // TODO: Fix scan-pr tests once local directory solution is implemented func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") bbClient, testDetails := bitbucketServerTestsInit(t) runScanPullRequestCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index a39298113..fea5068ed 100644 --- a/github_test.go +++ b/github_test.go @@ -36,6 +36,7 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails // TODO: Fix scan-pr tests once local directory solution is implemented func TestGitHub_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") githubClient, testDetails := githubTestsInit(t) runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index a492ffe2d..16dd36b45 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -36,6 +36,7 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails // TODO: Fix scan-pr tests once local directory solution is implemented func TestGitLab_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") gitlabClient, testDetails := gitlabTestsInit(t) runScanPullRequestCmd(t, gitlabClient, testDetails) } From 9de336e07f7d26f23fcf174b14c93fdf09cba0c6 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Wed, 15 Apr 2026 15:18:32 +0300 Subject: [PATCH 03/14] . --- azure_test.go | 4 ++-- bitbucket_server_test.go | 4 ++-- github_test.go | 10 +--------- gitlab_test.go | 10 +--------- utils/consts.go | 1 - utils/getconfiguration.go | 7 ------- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/azure_test.go b/azure_test.go index 4df469e10..01aecf609 100644 --- a/azure_test.go +++ b/azure_test.go @@ -34,14 +34,14 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet return azureClient, testDetails } -// TODO: Fix scan-pr tests once local directory solution is implemented func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") azureClient, testDetails := azureReposTestsInit(t) runScanPullRequestCmd(t, azureClient, testDetails) } func TestAzureRepos_ScanRepositoryIntegration(t *testing.T) { + t.Error("Fix Azure scan-repo test after creating new test user") azureClient, testDetails := azureReposTestsInit(t) runScanRepositoryCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index e00ba81cf..6155b813b 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -61,14 +61,14 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe return bbClient, testDetails } -// TODO: Fix scan-pr tests once local directory solution is implemented func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") bbClient, testDetails := bitbucketServerTestsInit(t) runScanPullRequestCmd(t, bbClient, testDetails) } func TestBitbucketServer_ScanRepositoryIntegration(t *testing.T) { + t.Error("Fix BitbucketServer scan-repo test after creating new test user") bbClient, testDetails := bitbucketServerTestsInit(t) runScanRepositoryCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index fea5068ed..02f4d2f9b 100644 --- a/github_test.go +++ b/github_test.go @@ -1,7 +1,6 @@ package main import ( - "os" "testing" "github.com/jfrog/frogbot/v2/utils" @@ -34,20 +33,13 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails return githubClient, testDetails } -// TODO: Fix scan-pr tests once local directory solution is implemented func TestGitHub_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") githubClient, testDetails := githubTestsInit(t) runScanPullRequestCmd(t, githubClient, testDetails) } -// TODO set a profile without JAS for the test func TestGitHub_ScanRepositoryIntegration(t *testing.T) { - assert.NoError(t, os.Setenv(utils.EnableFrogbotV3FixEnv, "true")) - defer func() { - assert.NoError(t, os.Unsetenv(utils.EnableFrogbotV3FixEnv)) - }() - githubClient, testDetails := githubTestsInit(t) runScanRepositoryCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index 16dd36b45..bc8433ae7 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -1,7 +1,6 @@ package main import ( - "os" "testing" "github.com/jfrog/frogbot/v2/utils" @@ -34,20 +33,13 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails return gitlabClient, testDetails } -// TODO: Fix scan-pr tests once local directory solution is implemented func TestGitLab_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan is not yes supported in V3. Skipping the test.") + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") gitlabClient, testDetails := gitlabTestsInit(t) runScanPullRequestCmd(t, gitlabClient, testDetails) } -// TODO set a profile without JAS for the test func TestGitLab_ScanRepositoryIntegration(t *testing.T) { - assert.NoError(t, os.Setenv(utils.EnableFrogbotV3FixEnv, "true")) - defer func() { - assert.NoError(t, os.Unsetenv(utils.EnableFrogbotV3FixEnv)) - }() - gitlabClient, testDetails := gitlabTestsInit(t) runScanRepositoryCmd(t, gitlabClient, testDetails) } diff --git a/utils/consts.go b/utils/consts.go index 58e512e19..ddb466930 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -9,7 +9,6 @@ type ciProvider string const ( // TODO delete this env var and its usages when we re-enable fixes for all package manager - EnableFrogbotV3FixEnv = "JF_ENABLE_FROGBOT_V3_FIX" // MaxConcurrentScanners represents the maximum number of threads for running JFrog CLI scanners concurrently MaxConcurrentScanners = 5 diff --git a/utils/getconfiguration.go b/utils/getconfiguration.go index 592744c8d..3c1eb901b 100644 --- a/utils/getconfiguration.go +++ b/utils/getconfiguration.go @@ -511,12 +511,5 @@ func getConfigurationProfile(xrayVersion string, jfrogServer *coreconfig.ServerD } log.Info(fmt.Sprintf("Using Config profile '%s'", configProfile.ProfileName)) - // TODO: Remove this block once autofix logic is added - enableFix, err := getBoolEnv(EnableFrogbotV3FixEnv, false) - if !enableFix { - configProfile.FrogbotConfig.CreateAutoFixPr = false - } else { - log.Info("Currently, Frogbot V3 fixing process is disabled by default. To enable fixing functionality, please set the 'JF_ENABLE_FROGBOT_V3_FIX' environment variable to 'true'.") - } return } From 7efa4b9b4381f11d88f64976263b1b17fe8857f3 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Wed, 15 Apr 2026 15:20:45 +0300 Subject: [PATCH 04/14] . --- utils/getconfiguration.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/getconfiguration.go b/utils/getconfiguration.go index b4941e6c9..3c1eb901b 100644 --- a/utils/getconfiguration.go +++ b/utils/getconfiguration.go @@ -511,7 +511,5 @@ func getConfigurationProfile(xrayVersion string, jfrogServer *coreconfig.ServerD } log.Info(fmt.Sprintf("Using Config profile '%s'", configProfile.ProfileName)) - // TODO: Remove this line once new Config Profile is merged - configProfile.FrogbotConfig.CreateAutoFixPr = true return } From 640889b0e8e3ba79ded12ca101138520ec517d06 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Wed, 15 Apr 2026 16:43:55 +0300 Subject: [PATCH 05/14] . --- utils/consts.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/consts.go b/utils/consts.go index ddb466930..f124f9e1a 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -8,8 +8,6 @@ type vcsProvider string type ciProvider string const ( - // TODO delete this env var and its usages when we re-enable fixes for all package manager - // MaxConcurrentScanners represents the maximum number of threads for running JFrog CLI scanners concurrently MaxConcurrentScanners = 5 From 79fcaceadfdc9cc788bdfcb28df696aa7dce7eca Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 14:01:25 +0300 Subject: [PATCH 06/14] fixed TestGitLab_ScanRepositoryIntegration and TestGitHub_ScanRepositoryIntegration --- integrationutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrationutils.go b/integrationutils.go index 59b923843..84abf0ae0 100644 --- a/integrationutils.go +++ b/integrationutils.go @@ -221,7 +221,7 @@ func runScanRepositoryCmd(t *testing.T, client vcsclient.VcsClient, testDetails expectedBranches := []string{ "frogbot-snyk-5aaa88cc32aaaf2d8d893decd0a1b284", - "frogbot-lodash-aa38d67476e2ac9a5f7011b7c2c6728b", + "frogbot-lodash-36ab76ead8f9cace70988ea19d280c93", "frogbot-minimist-e6e68f7e53c2b59c6bd946e00af797f7", } for _, expectedBranch := range expectedBranches { From 77f68a3d9b4fa1086ae224953f7b3fe1170e03c6 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 14:13:31 +0300 Subject: [PATCH 07/14] . --- azure_test.go | 2 +- bitbucket_server_test.go | 2 +- github_test.go | 2 +- gitlab_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure_test.go b/azure_test.go index 01aecf609..63e2b6d0e 100644 --- a/azure_test.go +++ b/azure_test.go @@ -35,8 +35,8 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet } func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") azureClient, testDetails := azureReposTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index 6155b813b..f50c94f20 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -62,8 +62,8 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe } func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") bbClient, testDetails := bitbucketServerTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index 02f4d2f9b..0278bc77f 100644 --- a/github_test.go +++ b/github_test.go @@ -34,8 +34,8 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitHub_ScanPullRequestIntegration(t *testing.T) { - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") githubClient, testDetails := githubTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index bc8433ae7..8424d0614 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -34,8 +34,8 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitLab_ScanPullRequestIntegration(t *testing.T) { - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") gitlabClient, testDetails := gitlabTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, gitlabClient, testDetails) } From 8443c18bc7f0a4aefc84f63d987d4a291831027b Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 14:57:49 +0300 Subject: [PATCH 08/14] Switch usages to new env vars names in yml files --- .github/workflows/release-gate.yml | 8 ++++---- .github/workflows/test.yml | 8 ++++---- azure_test.go | 4 ++-- bitbucket_server_test.go | 4 ++-- github_test.go | 2 +- gitlab_test.go | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-gate.yml b/.github/workflows/release-gate.yml index 5f53b5029..710eebac9 100644 --- a/.github/workflows/release-gate.yml +++ b/.github/workflows/release-gate.yml @@ -146,7 +146,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_GITHUB_TOKEN: ${{ secrets.FROGBOT_TESTS_GITHUB_TOKEN }} + FROGBOT_V3_TESTS_GITHUB_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_GITHUB_TOKEN }} azure-integration: name: Azure Integration Tests @@ -182,7 +182,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_AZURE_TOKEN: ${{ secrets.FROGBOT_TESTS_AZURE_TOKEN }} + FROGBOT_TESTS_AZURE_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_AZURE_TOKEN }} gitlab-integration: name: GitLab Integration Tests @@ -218,7 +218,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_GITLAB_TOKEN: ${{ secrets.FROGBOT_TESTS_GITLAB_TOKEN }} + FROGBOT_V3_TESTS_GITLAB_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_GITLAB_TOKEN }} bitbucket-server-integration: name: Bitbucket Server Integration Tests @@ -283,7 +283,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_TESTS_BB_SERVER_TOKEN }} + FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_BB_SERVER_TOKEN }} run: go test -v bitbucket_server_test.go commands.go integrationutils.go - name: Display Logs on Failure diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc205cf29..817a019ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -221,7 +221,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_GITHUB_TOKEN: ${{ secrets.FROGBOT_TESTS_GITHUB_TOKEN }} + FROGBOT_V3_TESTS_GITHUB_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_GITHUB_TOKEN }} azure-integration: name: Azure Integration Tests @@ -266,7 +266,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_AZURE_TOKEN: ${{ secrets.FROGBOT_TESTS_AZURE_TOKEN }} + FROGBOT_TESTS_AZURE_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_AZURE_TOKEN }} gitlab-integration: name: GitLab Integration Tests @@ -311,7 +311,7 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_GITLAB_TOKEN: ${{ secrets.FROGBOT_TESTS_GITLAB_TOKEN }} + FROGBOT_V3_TESTS_GITLAB_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_GITLAB_TOKEN }} bitbucket-server-integration: name: Bitbucket Server Integration Tests @@ -359,6 +359,6 @@ jobs: env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_TESTS_BB_SERVER_TOKEN }} + FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_BB_SERVER_TOKEN }} JFROG_CLI_LOG_LEVEL: "DEBUG" run: go test -v bitbucket_server_test.go commands.go integrationutils.go diff --git a/azure_test.go b/azure_test.go index 63e2b6d0e..c617e563f 100644 --- a/azure_test.go +++ b/azure_test.go @@ -35,13 +35,13 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet } func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan tests are not yet fixed.") azureClient, testDetails := azureReposTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, azureClient, testDetails) } func TestAzureRepos_ScanRepositoryIntegration(t *testing.T) { - t.Error("Fix Azure scan-repo test after creating new test user") + t.Skip("Fix Azure scan-repo test after creating new test user") azureClient, testDetails := azureReposTestsInit(t) runScanRepositoryCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index f50c94f20..e94ae10a6 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -62,13 +62,13 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe } func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan tests are not yet fixed.") bbClient, testDetails := bitbucketServerTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, bbClient, testDetails) } func TestBitbucketServer_ScanRepositoryIntegration(t *testing.T) { - t.Error("Fix BitbucketServer scan-repo test after creating new test user") + t.Skip("Fix BitbucketServer scan-repo test after creating new test user") bbClient, testDetails := bitbucketServerTestsInit(t) runScanRepositoryCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index 0278bc77f..42627e6f0 100644 --- a/github_test.go +++ b/github_test.go @@ -34,8 +34,8 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitHub_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan tests are not yet fixed.") githubClient, testDetails := githubTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index 8424d0614..36df4faaa 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -34,8 +34,8 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitLab_ScanPullRequestIntegration(t *testing.T) { + t.Skip("Pull Request Scan tests are not yet fixed.") gitlabClient, testDetails := gitlabTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed. Skipping...") runScanPullRequestCmd(t, gitlabClient, testDetails) } From e38397f7aab4c501685a453b4239537a0587b590 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 15:38:14 +0300 Subject: [PATCH 09/14] . --- azure_test.go | 2 +- bitbucket_server_test.go | 2 +- github_test.go | 2 +- gitlab_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure_test.go b/azure_test.go index c617e563f..7e2e9de00 100644 --- a/azure_test.go +++ b/azure_test.go @@ -35,8 +35,8 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet } func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan tests are not yet fixed.") azureClient, testDetails := azureReposTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index e94ae10a6..391fc2536 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -62,8 +62,8 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe } func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan tests are not yet fixed.") bbClient, testDetails := bitbucketServerTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index 42627e6f0..21ec04ae0 100644 --- a/github_test.go +++ b/github_test.go @@ -34,8 +34,8 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitHub_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan tests are not yet fixed.") githubClient, testDetails := githubTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index 36df4faaa..e6e54fcdb 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -34,8 +34,8 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitLab_ScanPullRequestIntegration(t *testing.T) { - t.Skip("Pull Request Scan tests are not yet fixed.") gitlabClient, testDetails := gitlabTestsInit(t) + t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, gitlabClient, testDetails) } From 3459f74d349ced267012af1e0c432f47d8282faf Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 16:31:06 +0300 Subject: [PATCH 10/14] . --- azure_test.go | 1 - bitbucket_server_test.go | 1 - github_test.go | 1 - gitlab_test.go | 1 - 4 files changed, 4 deletions(-) diff --git a/azure_test.go b/azure_test.go index 7e2e9de00..e72d3ef2b 100644 --- a/azure_test.go +++ b/azure_test.go @@ -36,7 +36,6 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { azureClient, testDetails := azureReposTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index 391fc2536..4017587e8 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -63,7 +63,6 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { bbClient, testDetails := bitbucketServerTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index 21ec04ae0..2bc27d208 100644 --- a/github_test.go +++ b/github_test.go @@ -35,7 +35,6 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails func TestGitHub_ScanPullRequestIntegration(t *testing.T) { githubClient, testDetails := githubTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index e6e54fcdb..3c545b096 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -35,7 +35,6 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails func TestGitLab_ScanPullRequestIntegration(t *testing.T) { gitlabClient, testDetails := gitlabTestsInit(t) - t.Error("Pull Request Scan tests are not yet fixed.") runScanPullRequestCmd(t, gitlabClient, testDetails) } From 08110b5a0ade4bbe9cc11ce727e68a347d6c8cfb Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 16:43:15 +0300 Subject: [PATCH 11/14] . --- azure_test.go | 1 + bitbucket_server_test.go | 1 + github_test.go | 1 + gitlab_test.go | 1 + 4 files changed, 4 insertions(+) diff --git a/azure_test.go b/azure_test.go index e72d3ef2b..8cf917b84 100644 --- a/azure_test.go +++ b/azure_test.go @@ -36,6 +36,7 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { azureClient, testDetails := azureReposTestsInit(t) + t.Fail() runScanPullRequestCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index 4017587e8..e850c16fc 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -63,6 +63,7 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { bbClient, testDetails := bitbucketServerTestsInit(t) + t.Fail() runScanPullRequestCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index 2bc27d208..d683cf85c 100644 --- a/github_test.go +++ b/github_test.go @@ -35,6 +35,7 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails func TestGitHub_ScanPullRequestIntegration(t *testing.T) { githubClient, testDetails := githubTestsInit(t) + t.Fail() runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index 3c545b096..61b679190 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -35,6 +35,7 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails func TestGitLab_ScanPullRequestIntegration(t *testing.T) { gitlabClient, testDetails := gitlabTestsInit(t) + t.Fail() runScanPullRequestCmd(t, gitlabClient, testDetails) } From 118ad63cae41631e5f7af9ceacd58a9a6b1f3619 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 17:34:35 +0300 Subject: [PATCH 12/14] decoupling integration tests (main package) from Unit Tests suit using a build tag --- .github/workflows/release-gate.yml | 8 ++++---- .github/workflows/test.yml | 8 ++++---- azure_test.go | 2 ++ bitbucket_server_test.go | 2 ++ github_test.go | 2 ++ gitlab_test.go | 2 ++ integrationutils.go | 2 ++ 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-gate.yml b/.github/workflows/release-gate.yml index 710eebac9..1d5ca966f 100644 --- a/.github/workflows/release-gate.yml +++ b/.github/workflows/release-gate.yml @@ -142,7 +142,7 @@ jobs: run: python3 -m pip install pipenv poetry - name: Run Tests - run: go test github_test.go integrationutils.go commands.go -v -race -timeout 30m -cover + run: go test -tags integration github_test.go integrationutils.go commands.go -v -race -timeout 30m -cover env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} @@ -178,7 +178,7 @@ jobs: run: python3 -m pip install pipenv poetry - name: Run Tests - run: go test azure_test.go integrationutils.go commands.go -v -race -timeout 30m -cover + run: go test -tags integration azure_test.go integrationutils.go commands.go -v -race -timeout 30m -cover env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} @@ -214,7 +214,7 @@ jobs: run: python3 -m pip install pipenv poetry - name: Run Tests - run: go test gitlab_test.go integrationutils.go commands.go -v -race -timeout 30m -cover + run: go test -tags integration gitlab_test.go integrationutils.go commands.go -v -race -timeout 30m -cover env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} @@ -284,7 +284,7 @@ jobs: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_BB_SERVER_TOKEN }} - run: go test -v bitbucket_server_test.go commands.go integrationutils.go + run: go test -tags integration -v bitbucket_server_test.go commands.go integrationutils.go - name: Display Logs on Failure if: failure() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 817a019ca..c40a8bee6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -217,7 +217,7 @@ jobs: ${{ runner.os }}-go- - name: Run Tests - run: go test github_test.go integrationutils.go commands.go -v -race -timeout 30m -cover + run: go test -tags integration github_test.go integrationutils.go commands.go -v -race -timeout 30m -cover env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} @@ -262,7 +262,7 @@ jobs: ${{ runner.os }}-go- - name: Run Tests - run: go test azure_test.go integrationutils.go commands.go -v -race -timeout 30m -cover + run: go test -tags integration azure_test.go integrationutils.go commands.go -v -race -timeout 30m -cover env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} @@ -307,7 +307,7 @@ jobs: ${{ runner.os }}-go- - name: Run Tests - run: go test gitlab_test.go integrationutils.go commands.go -v -race -timeout 30m -cover + run: go test -tags integration gitlab_test.go integrationutils.go commands.go -v -race -timeout 30m -cover env: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} @@ -361,4 +361,4 @@ jobs: JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_V3_TESTS_BB_SERVER_TOKEN }} JFROG_CLI_LOG_LEVEL: "DEBUG" - run: go test -v bitbucket_server_test.go commands.go integrationutils.go + run: go test -tags integration -v bitbucket_server_test.go commands.go integrationutils.go diff --git a/azure_test.go b/azure_test.go index 8cf917b84..a71d298ee 100644 --- a/azure_test.go +++ b/azure_test.go @@ -1,3 +1,5 @@ +//go:build integration + package main import ( diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index e850c16fc..a1086287a 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -1,3 +1,5 @@ +//go:build integration + package main import ( diff --git a/github_test.go b/github_test.go index d683cf85c..fb0da2c8a 100644 --- a/github_test.go +++ b/github_test.go @@ -1,3 +1,5 @@ +//go:build integration + package main import ( diff --git a/gitlab_test.go b/gitlab_test.go index 61b679190..69bbb6bb5 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -1,3 +1,5 @@ +//go:build integration + package main import ( diff --git a/integrationutils.go b/integrationutils.go index 84abf0ae0..72e60f366 100644 --- a/integrationutils.go +++ b/integrationutils.go @@ -1,3 +1,5 @@ +//go:build integration + package main import ( From 9d491d16ca24d1498e52b3edbb97c15e0147e532 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Sun, 19 Apr 2026 17:36:51 +0300 Subject: [PATCH 13/14] . --- azure_test.go | 3 +-- bitbucket_server_test.go | 3 +-- github_test.go | 2 +- gitlab_test.go | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/azure_test.go b/azure_test.go index a71d298ee..d2978c750 100644 --- a/azure_test.go +++ b/azure_test.go @@ -37,13 +37,12 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet } func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { - azureClient, testDetails := azureReposTestsInit(t) t.Fail() + azureClient, testDetails := azureReposTestsInit(t) runScanPullRequestCmd(t, azureClient, testDetails) } func TestAzureRepos_ScanRepositoryIntegration(t *testing.T) { - t.Skip("Fix Azure scan-repo test after creating new test user") azureClient, testDetails := azureReposTestsInit(t) runScanRepositoryCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index a1086287a..9a12db3b5 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -64,13 +64,12 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe } func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { - bbClient, testDetails := bitbucketServerTestsInit(t) t.Fail() + bbClient, testDetails := bitbucketServerTestsInit(t) runScanPullRequestCmd(t, bbClient, testDetails) } func TestBitbucketServer_ScanRepositoryIntegration(t *testing.T) { - t.Skip("Fix BitbucketServer scan-repo test after creating new test user") bbClient, testDetails := bitbucketServerTestsInit(t) runScanRepositoryCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index fb0da2c8a..9b8a0b8dd 100644 --- a/github_test.go +++ b/github_test.go @@ -36,8 +36,8 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitHub_ScanPullRequestIntegration(t *testing.T) { - githubClient, testDetails := githubTestsInit(t) t.Fail() + githubClient, testDetails := githubTestsInit(t) runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index 69bbb6bb5..e1f87cd67 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -36,8 +36,8 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitLab_ScanPullRequestIntegration(t *testing.T) { - gitlabClient, testDetails := gitlabTestsInit(t) t.Fail() + gitlabClient, testDetails := gitlabTestsInit(t) runScanPullRequestCmd(t, gitlabClient, testDetails) } From 2367daf445a103e531b8acbcb9f51b99dddeac62 Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Thu, 30 Apr 2026 13:21:28 +0300 Subject: [PATCH 14/14] . --- azure_test.go | 2 +- bitbucket_server_test.go | 2 +- github_test.go | 2 +- gitlab_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure_test.go b/azure_test.go index d2978c750..4cdd2b648 100644 --- a/azure_test.go +++ b/azure_test.go @@ -37,7 +37,7 @@ func azureReposTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDet } func TestAzureRepos_ScanPullRequestIntegration(t *testing.T) { - t.Fail() + t.Fatal("ScanPullRequest integration test is not yet implemented") azureClient, testDetails := azureReposTestsInit(t) runScanPullRequestCmd(t, azureClient, testDetails) } diff --git a/bitbucket_server_test.go b/bitbucket_server_test.go index 9a12db3b5..a36fff1a2 100644 --- a/bitbucket_server_test.go +++ b/bitbucket_server_test.go @@ -64,7 +64,7 @@ func bitbucketServerTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTe } func TestBitbucketServer_ScanPullRequestIntegration(t *testing.T) { - t.Fail() + t.Fatal("ScanPullRequest integration test is not yet implemented") bbClient, testDetails := bitbucketServerTestsInit(t) runScanPullRequestCmd(t, bbClient, testDetails) } diff --git a/github_test.go b/github_test.go index 9b8a0b8dd..4a67c346a 100644 --- a/github_test.go +++ b/github_test.go @@ -36,7 +36,7 @@ func githubTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitHub_ScanPullRequestIntegration(t *testing.T) { - t.Fail() + t.Fatal("ScanPullRequest integration test is not yet implemented") githubClient, testDetails := githubTestsInit(t) runScanPullRequestCmd(t, githubClient, testDetails) } diff --git a/gitlab_test.go b/gitlab_test.go index e1f87cd67..5c46557cc 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -36,7 +36,7 @@ func gitlabTestsInit(t *testing.T) (vcsclient.VcsClient, *IntegrationTestDetails } func TestGitLab_ScanPullRequestIntegration(t *testing.T) { - t.Fail() + t.Fatal("ScanPullRequest integration test is not yet implemented") gitlabClient, testDetails := gitlabTestsInit(t) runScanPullRequestCmd(t, gitlabClient, testDetails) }