Skip to content

WIP: action to check engine against published rules#1700

Draft
alexfurmenkov wants to merge 10 commits intomainfrom
798-test-against-published
Draft

WIP: action to check engine against published rules#1700
alexfurmenkov wants to merge 10 commits intomainfrom
798-test-against-published

Conversation

@alexfurmenkov
Copy link
Copy Markdown
Collaborator

@alexfurmenkov alexfurmenkov commented Apr 22, 2026

workflow to run validation for all published rules, comparing with benchmark validation results

cdisc-org/cdisc-open-rules#22 with changes to allow validation from this repo

Comment on lines +48 to +60
- name: Checkout cdisc-open-rules
uses: actions/checkout@v6
with:
repository: cdisc-org/cdisc-open-rules
ref: ${{ inputs.rules_ref || 'main' }}
path: open-rules
# If cdisc-open-rules is private, add a PAT secret:
# token: ${{ secrets.CDISC_OPEN_RULES_TOKEN }}

# -----------------------------------------------------------------------
# 3. Set up Python
# -----------------------------------------------------------------------
- name: Set up Python 3.12
Copy link
Copy Markdown
Collaborator

@gerrycampion gerrycampion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really nice, but I have some comments

Comment thread .github/workflows/validate-published-rules.yml Outdated
Comment thread .github/workflows/validate-published-rules.yml Outdated
uses: actions/checkout@v6
with:
repository: cdisc-org/cdisc-rules-engine
ref: ${{ inputs.engine_ref || github.sha }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ref for engine checkout. It should use whatever the default is.

Comment thread .github/workflows/validate-published-rules.yml Outdated
Copy link
Copy Markdown
Collaborator

@gerrycampion gerrycampion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary and detailed outputs look awesome. I have one comment, sorry I didn't pickup on this earlier. Hopefully it is an easy conversion for ai.

Comment on lines +94 to +110
# Write the JSON-line parser once; called once per test case in the loop below
cat > /tmp/parse_case.py << 'PYEOF'
import sys, json, shlex
d = json.load(sys.stdin)
for k, v in [
('CASE_RULE', d['rule']),
('CASE_TYPE', d['type']),
('CASE_NUM', str(d['num'])),
('EXEC_OK', '\u2705' if d['exec'] else '\u274c'),
('EXPECTED', str(d.get('expected', ''))),
('GOT', str(d.get('got', ''))),
('MATCH', '\u2705' if d.get('match') else '\u274c'),
('DIFF_FILE', str(d.get('diff', ''))),
('STDERR_FILE', str(d.get('stderr', ''))),
]:
print(k + '=' + shlex.quote(v))
PYEOF
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just go in a python file in /scripts. In fact, I think this entire Run validation for all Published rules job after the first call to run_validation.sh should go in a python file for easier maintenance. I would copy this utility to simplify markdown table creation: https://github.com/cdisc-org/CORE_Test_Suite/blob/main/scripts/markdown_utils.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action to run all published rules' tests

3 participants