From 85efe66968f0ba8487712a1b3c9b5f176e56a975 Mon Sep 17 00:00:00 2001 From: agrasth Date: Tue, 9 Dec 2025 15:57:05 +0530 Subject: [PATCH 1/7] fix: use local Artifactory for lifecycle tests to prevent project quota issues ## Problem Lifecycle tests were failing with 'Cannot create project, Max number of projects is reached' because they used a shared remote platform that accumulated orphaned test projects from failed test runs. ## Solution Switch lifecycle tests to use local Artifactory installation, matching the pattern used by all other test suites. ## Changes - Use jfrog/.github/actions/install-local-artifactory@main - Connect to http://127.0.0.1:8082 instead of secrets.PLATFORM_URL - Use auto-generated JFROG_TESTS_LOCAL_ACCESS_TOKEN - Add macOS skip logic (JGC-413) - Explicit OS version matrix for consistency - Fix syntax error in deleteProjectIfExists: t.Error(t, err) -> t.Error(err) ## Benefits - No shared state between test runs - No manual cleanup required - Better test isolation - Consistent with other test workflows - Each test run gets fresh Artifactory instance --- .github/workflows/lifecycleTests.yml | 30 ++++++++++++++++++++++++---- artifactory_test.go | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lifecycleTests.yml b/.github/workflows/lifecycleTests.yml index 955dfd7ce..e7e20a979 100644 --- a/.github/workflows/lifecycleTests.yml +++ b/.github/workflows/lifecycleTests.yml @@ -18,21 +18,43 @@ concurrency: cancel-in-progress: true jobs: Lifecycle-Tests: - name: Lifecycle tests (${{ matrix.os }}) + name: Lifecycle tests (${{ matrix.os.name }}) if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test') strategy: fail-fast: false matrix: - os: [ubuntu, windows, macos] - runs-on: ${{ matrix.os }}-latest + os: + - name: ubuntu + version: 24.04 + - name: windows + version: 2022 + - name: macos + version: 14 + runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} steps: + - name: Skip macOS - JGC-413 + if: matrix.os.name == 'macos' + run: | + echo "::warning::JGC-413 - Skip until artifactory bootstrap in osx is fixed" + exit 0 + - name: Checkout code + if: matrix.os.name != 'macos' uses: actions/checkout@v5 with: ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: Setup Go with cache + if: matrix.os.name != 'macos' uses: jfrog/.github/actions/install-go-with-cache@main + - name: Install local Artifactory + if: matrix.os.name != 'macos' + uses: jfrog/.github/actions/install-local-artifactory@main + with: + RTLIC: ${{ secrets.RTLIC }} + RT_CONNECTION_TIMEOUT_SECONDS: ${{ env.RT_CONNECTION_TIMEOUT_SECONDS || '1200' }} + - name: Run Lifecycle tests - run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.lifecycle --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --ci.runId=${{ runner.os }}-lifecycle + if: matrix.os.name != 'macos' + run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.lifecycle --jfrog.url=http://127.0.0.1:8082 --jfrog.adminToken=${{ env.JFROG_TESTS_LOCAL_ACCESS_TOKEN }} --ci.runId=${{ runner.os }}-lifecycle diff --git a/artifactory_test.go b/artifactory_test.go index 8be891ecf..7f87e7586 100644 --- a/artifactory_test.go +++ b/artifactory_test.go @@ -6492,7 +6492,7 @@ func deleteProjectIfExists(t *testing.T, accessManager *access.AccessServicesMan err := accessManager.DeleteProject(projectKey) if err != nil { if !strings.Contains(err.Error(), "Could not find project") { - t.Error(t, err) + t.Error(err) } } } From bc19617cd5015b176a0b1c5f70bae4c3ec3e9895 Mon Sep 17 00:00:00 2001 From: Agrasth Naman Date: Tue, 9 Dec 2025 16:48:26 +0530 Subject: [PATCH 2/7] Updated macos version to 15 --- .github/workflows/scriptTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scriptTests.yml b/.github/workflows/scriptTests.yml index 057a28aac..0596dbf4c 100644 --- a/.github/workflows/scriptTests.yml +++ b/.github/workflows/scriptTests.yml @@ -37,7 +37,7 @@ jobs: osSuffix: "" - name: macos - version: 13 + version: 15 osSuffix: "" - name: windows From 4b659eb19b88c201fae273f41ea4f36d0e855c5a Mon Sep 17 00:00:00 2001 From: Agrasth Naman Date: Tue, 9 Dec 2025 16:49:47 +0530 Subject: [PATCH 3/7] Add branch to trigger workflow on push events --- .github/workflows/scriptTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scriptTests.yml b/.github/workflows/scriptTests.yml index 0596dbf4c..80d99f023 100644 --- a/.github/workflows/scriptTests.yml +++ b/.github/workflows/scriptTests.yml @@ -4,6 +4,7 @@ on: push: branches: - "master" + - "fix/lifecycle-tests-local-artifactory" # Triggers the workflow on PRs to master branch only. pull_request_target: types: [labeled] From 78048e2b77abc1380eb774ccd4058ad391cb692a Mon Sep 17 00:00:00 2001 From: Agrasth Naman Date: Tue, 9 Dec 2025 17:02:29 +0530 Subject: [PATCH 4/7] Update scriptTests.yml to modify push branches --- .github/workflows/scriptTests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/scriptTests.yml b/.github/workflows/scriptTests.yml index 80d99f023..0596dbf4c 100644 --- a/.github/workflows/scriptTests.yml +++ b/.github/workflows/scriptTests.yml @@ -4,7 +4,6 @@ on: push: branches: - "master" - - "fix/lifecycle-tests-local-artifactory" # Triggers the workflow on PRs to master branch only. pull_request_target: types: [labeled] From ba2d32af9181a754e294896546636d992ff56dd3 Mon Sep 17 00:00:00 2001 From: agrasth Date: Tue, 9 Dec 2025 12:25:20 +0530 Subject: [PATCH 5/7] fix: use local Artifactory for lifecycle tests to prevent project quota issues - Switch lifecycle tests from remote platform to local Artifactory installation - Aligns with pattern used by all other test suites (artifactory, transfer, access, etc.) - Fixes syntax error in deleteProjectIfExists (t.Error(t, err) -> t.Error(err)) - Each test run gets fresh Artifactory instance, eliminating project accumulation - Resolves 'Cannot create project, Max number of projects is reached' errors Changes: - Use jfrog/.github/actions/install-local-artifactory@main - Connect to http://127.0.0.1:8082 instead of secrets.PLATFORM_URL - Use auto-generated JFROG_TESTS_LOCAL_ACCESS_TOKEN - Add macOS skip logic (JGC-413) - Explicit OS version matrix for consistency Benefits: - No shared state between test runs - No manual cleanup required - Better test isolation - Consistent with other test workflows --- .github/workflows/lifecycleTests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/lifecycleTests.yml b/.github/workflows/lifecycleTests.yml index e7e20a979..e9b66c767 100644 --- a/.github/workflows/lifecycleTests.yml +++ b/.github/workflows/lifecycleTests.yml @@ -48,6 +48,20 @@ jobs: if: matrix.os.name != 'macos' uses: jfrog/.github/actions/install-go-with-cache@main + - name: Debug macOS Environment and Set Timeout + if: runner.os == 'macOS' + run: | + echo "=== macOS Debug Information ===" + echo "Architecture: $(uname -m)" + echo "macOS Version: $(sw_vers -productVersion)" + echo "macOS Build: $(sw_vers -buildVersion)" + echo "Available memory: $(system_profiler SPHardwareDataType | grep Memory || echo 'Memory info not available')" + echo "Available disk space: $(df -h)" + echo "Java version: $(java -version 2>&1 || echo 'Java not found')" + echo "Go version: $(go version)" + echo "Setting RT_CONNECTION_TIMEOUT_SECONDS to 2400 for macOS" + echo "RT_CONNECTION_TIMEOUT_SECONDS=2400" >> $GITHUB_ENV + - name: Install local Artifactory if: matrix.os.name != 'macos' uses: jfrog/.github/actions/install-local-artifactory@main From c07611b2c3a396ebafe5205232a1e84f49543947 Mon Sep 17 00:00:00 2001 From: agrasth Date: Tue, 9 Dec 2025 22:00:41 +0530 Subject: [PATCH 6/7] Unskip lifecycle tests --- lifecycle_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lifecycle_test.go b/lifecycle_test.go index 19df1db38..9d465c2c3 100644 --- a/lifecycle_test.go +++ b/lifecycle_test.go @@ -1259,10 +1259,6 @@ func uploadBuildWithDepsAndProject(t *testing.T, buildName, buildNumber, project func initLifecycleTest(t *testing.T, minVersion string) (cleanCallback func()) { - if *tests.TestLifecycle { - t.Skip("Skipping lifecycle test temporarily.") - } - if !*tests.TestLifecycle { t.Skip("Skipping lifecycle test. To run release bundle test add the '-test.lc=true' option.") } From ecf83a64b445255b763486f8a661cad5c5a6648e Mon Sep 17 00:00:00 2001 From: Agrasth Naman Date: Tue, 9 Dec 2025 22:42:50 +0530 Subject: [PATCH 7/7] Skip lifecycle tests conditionally Added condition to skip lifecycle tests based on TestLifecycle flag. --- lifecycle_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lifecycle_test.go b/lifecycle_test.go index 9d465c2c3..19df1db38 100644 --- a/lifecycle_test.go +++ b/lifecycle_test.go @@ -1259,6 +1259,10 @@ func uploadBuildWithDepsAndProject(t *testing.T, buildName, buildNumber, project func initLifecycleTest(t *testing.T, minVersion string) (cleanCallback func()) { + if *tests.TestLifecycle { + t.Skip("Skipping lifecycle test temporarily.") + } + if !*tests.TestLifecycle { t.Skip("Skipping lifecycle test. To run release bundle test add the '-test.lc=true' option.") }