diff --git a/.github/workflows/test-fuzz.yml b/.github/workflows/test-fuzz.yml index efd74d90f4..4e66ac7d5e 100644 --- a/.github/workflows/test-fuzz.yml +++ b/.github/workflows/test-fuzz.yml @@ -87,3 +87,71 @@ jobs: run: | echo "Starting fuzz tests..." make test-fuzz + + test-fuzz-catalog: + name: Test Fuzz Catalog + runs-on: ubuntu-latest + defaults: + run: + working-directory: catalog/clients/python + steps: + - name: Get PR details + id: pr + uses: actions/github-script@v8 + with: + script: | + try { + const pr = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: ${{ github.event.inputs.pr_number }} + }); + return { + sha: pr.data.head.sha, + ref: pr.data.head.ref + }; + } catch (error) { + console.log(`Error fetching PR #${{ github.event.inputs.pr_number }}: ${error.message}`); + throw error; + } + + - name: Checkout PR + uses: actions/checkout@v6 + with: + ref: ${{ fromJson(steps.pr.outputs.result).sha }} + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install Poetry + run: | + pipx install poetry + + - name: Install dependencies + run: | + poetry install + + - name: Start Kind Cluster + uses: helm/kind-action@v1.13.0 + with: + node_image: kindest/node:v1.33.7 + cluster_name: catalog-fuzz + kubectl_version: v1.33.7 + + - name: Generate Tag + shell: bash + id: tags + run: | + commit_sha=${{ fromJson(steps.pr.outputs.result).sha }} + tag=fuzz-${commit_sha:0:7} + echo "tag=${tag}" | tee -a $GITHUB_OUTPUT + + - name: Run Fuzz Catalog Tests + env: + IMG_VERSION: ${{ steps.tags.outputs.tag }} + CLUSTER_NAME: catalog-fuzz + run: | + echo "Starting fuzz tests..." + make test-fuzz diff --git a/catalog/clients/python/Makefile b/catalog/clients/python/Makefile index 209c1a28b9..3aecd30ea1 100644 --- a/catalog/clients/python/Makefile +++ b/catalog/clients/python/Makefile @@ -100,7 +100,7 @@ test-e2e: CATALOG_URL=$${CATALOG_URL:-http://localhost:$(CATALOG_PORT)} poetry run pytest --e2e -v -rA .PHONY: test-fuzz -test-fuzz: +test-fuzz: deploy CATALOG_URL=$${CATALOG_URL:-http://localhost:$(CATALOG_PORT)} poetry run pytest --fuzz -v .PHONY: lint