Skip to content

Introducing Run Examples check in PRs #908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft

Introducing Run Examples check in PRs #908

wants to merge 32 commits into from

Conversation

jgchn
Copy link
Collaborator

@jgchn jgchn commented Apr 13, 2025

Fixes #856

This PR refactored test_run_examples.py by making it more modular. Specifically, it now reads a config file, namely test_run_examples.yaml, which outlines what files to check, skip, requires input, and expects errors during execution. This separation not only makes the code more readable, but also allows testing in different environments.

This PR also improved the logic of Run Examples. The nightly test remains. In addition, whenever a PR is opened, three new jobs are initiated. Each will execute Run Examples on PDL files that were modified and added to the repo. Below is a high-level overview of the implementation to achieve this behavior.

  • Ollama set up and Run Examples test now moved to a composite action, allowing reuse for PR checks vs. nightly tests (link)
  • For the nightly test, it just calls the composite action for run-examples with update-results: 'false' (link)
  • For the PR checks, a series of steps need to happen before using the run-examples composite action. In particular, detecting what PDL files were changed so that we can patch the config file with those files. After running the test, we must also commit the new results, if the user sets update_result: true in the PR. (link)

This PR finally updates contrib.md with more details on the behavior of Run Examples in local dev and GH environments (see link).

jgchn added 5 commits April 13, 2025 10:43
* Cleaning up run examples pipeline

Signed-off-by: Jing Chen <[email protected]>

Rm run examples composite

Signed-off-by: Jing Chen <[email protected]>

Halt early if no file patch

Signed-off-by: Jing Chen <[email protected]>

Better msg

Signed-off-by: Jing Chen <[email protected]>

Modify some PDL files

Signed-off-by: Jing Chen <[email protected]>

Revert revisions

Signed-off-by: Jing Chen <[email protected]>

Modify some PDL programs

Signed-off-by: Jing Chen <[email protected]>

Fix if

Signed-off-by: Jing Chen <[email protected]>

Composite run examples

Signed-off-by: Jing Chen <[email protected]>

Checkout before using composite

Test if

Test if again

Rm bash test

Fix unfound path

Update if check

Delete a folder and see if test runs

Bring back deleted example. Expects test to run

Test if examples config is patched

Mv yaml patch to composite action

Try another patch strategy

Change some files

Checkout again in run examples

Modify files

Typo in composite action

Use json in check parse

Try to escape json

Use changes instead in yaml action

Bring back Ollama set up

Gather new results from GH env

Clean up workflows

Fix lint

Modify chatbot example

Fix run examples config file

* Add possible results for react examples

* Preserve trailing white space

* See if a commit is pushed on my behalf

* Rename config file

* Diff pdl file

* Check if commit happens despite pytet failures

* Allow pytest failure and continue run

* github-actions[bot]: Updated results file when running examples on Mon Apr  7 23:24:42 UTC 2025

Signed-off-by: github-actions[bot] <[email protected]>

* Set max parallel to 1 to prevent race conditions

* See if yaml action is triggered

* Change master branch

* Fix pytest

* Set update results to true

* Test yaml actio again

* Update result to true

* Reverting update_results to False. If you wish to update again, change locally and push with change.

* WRite permissions

* Reverting update_results to False. If you wish to update again, change locally and push with change.

* Don't commit using yaml action

* Set update results to true

* github-actions[bot]: Updated results file when running examples on Tue Apr  8 20:11:04 UTC 2025

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Reverting update_results to False.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Try pytest failure

* Test pytest behavior again

* Test set +e

* Test again

* Set update to true to see if changed-files can capture results

* PR test

* github-actions[bot]: Updated results file when running examples

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* github-actions[bot]: Reverting update_result to false

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Test only with PR, not push

* github-actions[bot]: Updated results file when running examples

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* github-actions[bot]: Reverting update_result to false

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* No pdl file change

* Clean up and fix run examples nightly

Signed-off-by: Jing Chen <[email protected]>

* Fix empty parse

* Fix

* Bring back more models on ollama set up

* Contrib readme updates

---------

Signed-off-by: github-actions[bot] <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Jing Chen <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <75508867+github-actions[bot][email protected]>

Get new results for failing progs

github-actions[bot]: Run examples: updated result files on your behalf

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

github-actions[bot]: Run examples: reverting update_result to false on your behalf

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

See if ollama is cached

Try caching ollama

Set up Ollama outside composite action

Revert changes

Update runexamples config

Signed-off-by: Jing Chen <[email protected]>
Signed-off-by: Jing Chen <[email protected]>
github-actions[bot]: Run examples: reverting update_result to false on your behalf

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

github-actions[bot]: Run examples: updated result files on your behalf

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Revert patches

Signed-off-by: Jing Chen <[email protected]>
Signed-off-by: Jing Chen <[email protected]>
@jgchn jgchn marked this pull request as draft April 14, 2025 18:03
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.

Improve PR pipeline for run examples test
1 participant