Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/test-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion catalog/clients/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading