Skip to content

Commit

Permalink
Fake scripts/run_commit_tests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Aug 14, 2024
1 parent 56e0c30 commit 6b5a2d9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Job to Generate JUnit Report

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
generate-report:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Make Shell Script Executable
run: chmod +x scripts/generate_input.sh

- name: Run Shell Script to Generate Input File
run: |
./scripts/run_commit_tests.sh
- name: Run JUnit Report Generation Script
run: |
python scripts/into_junit.py /tmp/SHARED.UNITS > junit.xml
- name: Upload JUnit Report
uses: actions/upload-artifact@v3
with:
name: junit-report
path: junit.xml

- name: Display JUnit Test Results
uses: dorny/test-reporter@v1
with:
name: 'JUnit Results'
path: 'junit.xml'
reporter: 'junit'
5 changes: 1 addition & 4 deletions scripts/into_junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
def create_testcase_element(testclass, testname, stdout, identifier, got, expected, status, url):
testcase = ET.Element("testcase", classname=testclass, name=testname)

# Add properties with test description
properties = ET.SubElement(testcase, "properties")
property_element = ET.SubElement(properties, "property", name="test_description")
property_element.text = stdout
description = f"Test {identifier} with URL: {url}"

if status == "PASS":
system_out = ET.SubElement(testcase, "system-out")
Expand Down
8 changes: 8 additions & 0 deletions scripts/run_commit_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# This script generates the input file used by the Python script.
# Replace the following lines with the actual commands to generate the input file.

echo "| ANTI-REGRESSION.BC-COMP.01 | PASS |(https://example.com/test-report) | (assertEqualToResult (add-atom &kb (: axiom (nums 2 3)))) | (()) | (()) |" > /tmp/SHARED.UNITS

# You can add more lines or commands to generate additional input data

0 comments on commit 6b5a2d9

Please sign in to comment.