From 4320ede52b98204cf4438d65ddda065a28806361 Mon Sep 17 00:00:00 2001 From: clavedeluna Date: Tue, 17 Oct 2023 08:41:21 -0300 Subject: [PATCH] pygoat findings only if changset --- .github/workflows/codemod_pygoat.yml | 2 +- Makefile | 4 ++-- ...t_webgoat_findings.py => test_pygoat_findings.py} | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) rename ci_tests/{test_webgoat_findings.py => test_pygoat_findings.py} (65%) diff --git a/.github/workflows/codemod_pygoat.yml b/.github/workflows/codemod_pygoat.yml index e4eada36b..aabe7bae5 100644 --- a/.github/workflows/codemod_pygoat.yml +++ b/.github/workflows/codemod_pygoat.yml @@ -38,4 +38,4 @@ jobs: - name: Run Codemodder run: codemodder --output output.codetf pygoat - name: Check PyGoat Findings - run: make webgoat-test + run: make pygoat-test diff --git a/Makefile b/Makefile index 94947e941..c25e5c536 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ test: integration-test: ${PYTEST} integration_tests -webgoat-test: - ${PYTEST} -v ci_tests/test_webgoat_findings.py +pygoat-test: + ${PYTEST} -v ci_tests/test_pygoat_findings.py lint: pylint -v codemodder core_codemods tests integration_tests diff --git a/ci_tests/test_webgoat_findings.py b/ci_tests/test_pygoat_findings.py similarity index 65% rename from ci_tests/test_webgoat_findings.py rename to ci_tests/test_pygoat_findings.py index 8ce1d1ad6..f0701483b 100644 --- a/ci_tests/test_webgoat_findings.py +++ b/ci_tests/test_pygoat_findings.py @@ -17,17 +17,17 @@ @pytest.fixture(scope="session") -def webgoat_findings(): +def pygoat_findings(): with open("output.codetf") as ff: results = json.load(ff) - yield set([x["codemod"] for x in results["results"]]) + yield set([x["codemod"] for x in results["results"] if x["changeset"]]) -def test_num_webgoat_findings(webgoat_findings): - assert len(webgoat_findings) == len(EXPECTED_FINDINGS) +def test_num_pygoat_findings(pygoat_findings): + assert len(pygoat_findings) == len(EXPECTED_FINDINGS) @pytest.mark.parametrize("finding", EXPECTED_FINDINGS) -def test_webgoat_findings(webgoat_findings, finding): - assert finding in webgoat_findings +def test_pygoat_findings(pygoat_findings, finding): + assert finding in pygoat_findings