Skip to content

Commit

Permalink
pygoat findings only if changset
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Oct 17, 2023
1 parent d42216a commit 4320ede
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codemod_pygoat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4320ede

Please sign in to comment.