From e9252a86ac77ed21f867930c064336551e7819ed Mon Sep 17 00:00:00 2001 From: Adam Scerra Date: Wed, 14 May 2025 09:56:14 -0400 Subject: [PATCH 1/2] merge to simplify testing for plugin Signed-off-by: Adam Scerra --- .github/workflows/checks-sealights.yaml | 64 ++++++++++++------------- Makefile | 1 + 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/.github/workflows/checks-sealights.yaml b/.github/workflows/checks-sealights.yaml index 4c624f977..b7095347f 100644 --- a/.github/workflows/checks-sealights.yaml +++ b/.github/workflows/checks-sealights.yaml @@ -37,8 +37,6 @@ jobs: Initialize: runs-on: ubuntu-latest - env: - SEALIGHTS_LOG_LEVEL: none outputs: bsid: ${{ steps.sealights-scan.outputs.bsid }} steps: @@ -101,7 +99,7 @@ jobs: echo "[Sealights] Configuring SeaLights to scan the pull request branch" echo "Latest commit sha: ${LATEST_COMMIT_SHA}" echo "PR Number: ${PULL_REQUEST_NUMBER}" - ./slcli config create-pr-bsid --app ec-cli --target-branch "main" --pull-request-number ${PULL_REQUEST_NUMBER} --latest-commit ${LATEST_COMMIT_SHA} --repository-url https://github.com/enterprise-contract/ec-cli.git + ./slcli config create-pr-bsid --app ec-cli-test --target-branch "main" --pull-request-number ${PULL_REQUEST_NUMBER} --latest-commit ${LATEST_COMMIT_SHA} --repository-url https://github.com/enterprise-contract/ec-cli.git env: PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} LATEST_COMMIT_SHA: ${{github.event.pull_request.head.sha}} @@ -110,7 +108,7 @@ jobs: if: env.on-event == 'push' run: | echo "[Sealights] Configuring SeaLights to scan the main branch after pull request was closed" - ./slcli config create-bsid --app ec-cli --branch main --build ${LATEST_COMMIT_SHA} + ./slcli config create-bsid --app ec-cli-test --branch main --build ${LATEST_COMMIT_SHA} env: LATEST_COMMIT_SHA: ${{ github.sha }} @@ -153,32 +151,32 @@ jobs: - name: Test run: make test - Acceptance: - runs-on: ubuntu-latest - needs: [Initialize, Test] - env: - BSID: ${{ needs.Initialize.outputs.bsid }} - SEALIGHTS_LOG_LEVEL: none - SEALIGHTS_CONNECTION_TIMEOUT: 120s - steps: - - name: Restore workspace - uses: actions/cache@v4 - with: - path: ${{ github.workspace }} - key: workspace-${{ github.run_id }} - - - name: Update podman - run: | - "${GITHUB_WORKSPACE}/hack/ubuntu-podman-update.sh" - - name: Create a test session - run: ./slcli test start-stage --bsid=$BSID --testStage "Acceptance Tests" - - - name: Acceptance test - run: make acceptance-sealights - - - name: Upload test results, end test session - if: success() || failure() - run: | - cat ./junit-acceptance.xml - ./slcli test upload-reports --bsid=$BSID --report-location ./junit-acceptance.xml - ./slcli test end-stage --bsid=$BSID --executionId "Acceptance Tests" \ No newline at end of file + # Acceptance: + # runs-on: ubuntu-latest + # needs: Initialize + # env: + # BSID: ${{ needs.Initialize.outputs.bsid }} + # SEALIGHTS_CONNECTION_TIMEOUT: 120s + # steps: + # - name: Restore workspace + # uses: actions/cache@v4 + # with: + # path: ${{ github.workspace }} + # key: workspace-${{ github.run_id }} + + # - name: Update podman + # run: | + # "${GITHUB_WORKSPACE}/hack/ubuntu-podman-update.sh" + + # - name: Create a test session + # run: ./slcli test start-stage --bsid=$BSID --testStage "Acceptance Tests" + + # - name: Acceptance test + # run: make acceptance-sealights + + # - name: Upload test results, end test session + # if: success() || failure() + # run: | + # cat ./junit-acceptance.xml + # ./slcli test upload-reports --bsid=$BSID --report-location ./junit-acceptance.xml + # ./slcli test end-stage --bsid=$BSID --executionId "Acceptance Tests" \ No newline at end of file diff --git a/Makefile b/Makefile index 5f1e30502..eb8c6f859 100644 --- a/Makefile +++ b/Makefile @@ -141,6 +141,7 @@ acceptance-sealights: ## Run all acceptance tests with sealights integration $(MAKE) build && \ export COVERAGE_FILEPATH="$$ACCEPTANCE_WORKDIR"; \ export COVERAGE_FILENAME="-acceptance"; \ + ./slcli scan --tests-runner --workspacepath "acceptance" --path-to-scanner ./slgoagent --scm none; \ cd acceptance && SEALIGHTS_LOG_LEVEL=none go run -modfile "$$ACCEPTANCE_WORKDIR/tools/go.mod" gotest.tools/gotestsum --junitfile "$(ROOT_DIR)/junit-acceptance.xml" -- -parallel 1 -timeout $(ACCEPTANCE_TIMEOUT) ./... # Add @focus above the feature you're hacking on to use this From 6da1363322272fd783c942e3bf857ee63e80c067 Mon Sep 17 00:00:00 2001 From: Adam Scerra Date: Wed, 14 May 2025 11:25:09 -0400 Subject: [PATCH 2/2] trigger run to test github plugin Signed-off-by: Adam Scerra --- .github/workflows/checks-sealights.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks-sealights.yaml b/.github/workflows/checks-sealights.yaml index b7095347f..17d8f3e04 100644 --- a/.github/workflows/checks-sealights.yaml +++ b/.github/workflows/checks-sealights.yaml @@ -118,6 +118,7 @@ jobs: echo "[Sealights] Running the SeaLights scan" ./slcli scan --bsid buildSessionId.txt --path-to-scanner ./slgoagent --workspacepath ./ --scm git --scmBaseUrl https://github.com/enterprise-contract/ec-cli.git --scmVersion “0” --scmProvider github echo bsid=$(< buildSessionId.txt) | tee -a "$GITHUB_OUTPUT" + - name: clean all SeaLights secret stuff run: | echo "[Sealights] Cleaning up after SeaLights run"