PR test runner - #4140
Conversation
|
Ok looks like need to address https://github.com/EnricoMi/publish-unit-test-result-action/blob/v2.18.0/README.md#support-fork-repositories-and-dependabot-branches before the tests will run on PRs from separate repos. Will check this soon. Anyways can use review already. |
Haven't had much of a chance to review things (sorry!), but FYI the previous PR (#2626) was set up to handle fork PRs as described in that link. Could probably steal the setup from there at least as inspiration. |
Yeah I totally based on that one, I think I removed smth related when merging workflows into one file tho. Thx for the tip! |
Ok I think it's working now but the secondary workflows need to be in master for them to work. Difficult to tell tbh XD. I did try at saurtron#9 and still seems to work. Anyways I'll still tweak a bit since some things need to be changed when in 2 files and not sure everything is tuned right now. I tried before with 3 separate workflows (like yours + deploy), also with 2, so I'll review. |
bd43a2e, 139 more lines to read and maintain. Why? |
Seems we overlooked this: https://github.com/EnricoMi/publish-unit-test-result-action/blob/v2.18.0/README.md#support-fork-repositories-and-dependabot-branches Its just ~40 lines more btw, anyways doesn't seem to be much we can do about it, can't fix without some extra lines, sorry. |
A bit more background, after having checked the issue, that required those changes: This seems to be a security mechanism to avoid getting hacked through github actions, check this: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/. These parts are the most interesting: "Since, by definition, a PR supplies code to any build or test logic in place for your project, attackers can achieve arbitrary code execution in a workflow runner operating on a malicious PR in a variety of ways." "Due to the dangers inherent to automatic processing of PRs, GitHub’s standard pull_request workflow trigger by default prevents write permissions and secrets access to the target repository." |
Also, having read all that, I'd say the original three workflow way would be the most secure in order to avoid getting hacked by https://github.com/EnricoMi/publish-unit-test-result-action itself, although we could avoid that by having a private copy of that, or pinning some specific commit maybe. Not totally sure though, would have to read more about the permissions... also I think disabling comments for that action makes it not require write access to the repo. |
|
To keep code pretty, maybe add a linter? (I didn't see one being used) Just found this action available, but I am sure there are others. |
If you're going to add a lua linter, I'm personally fond of selene, a more active project -- there's also a github action. |
|
@saurtron what is the status of this? It's still in draft mode |
I think I'm going to split the run_tests_and_deploy (note: already did it, check below comment) out for now, so quick_deploy won't depend on tests for now, I'll also check all tests still pass properly. Then I will make an additional PR joining them again, to apply when we're sure it's not going to be disruptive. I think it's more sensible than trying to do everything in one go. It's great having tests blocking merge, or deploy if something broken is commited, but doesn't need to go all in in one go. Let me know if you don't like this approach, and give me 1-2 days and I'll prepare it so it can be merged already. |
Ok, did it already, also created #4737 as "part 2" so in the end is the same we had before and already reviewed. Now I need to check some |
|
Found a number of issues with tests on current master, fixes here:
Once those are in this can be "undrafted". |
p2004a
left a comment
There was a problem hiding this comment.
LGTM. Let's merge after those are fixed and see how it behaves.
4643179 to
b3c7787
Compare
|
Ok, the mentioned changes are in, so this is ready for final review. I have it merged at my repo's master, so if you want to see it work I think you can PR there. (probably a good idea so we see it works with external PR) I did a PR myself to myself, with the cmd-extension-mechanism as an example. saurtron#15 (you can see the test results there) |
|
@saurtron per saurtron#16 looks like some test is currently failing on master. Also can you explain the pending tests? Why pending is not failing? |
|
@saurtron What is the status of this? Is it ready to merge? |
Need to wait until engine After that will have to review and fix any current errors in master again. Sorry about that, its just merging this requires tests to be passing at the time and its kind of a moving target for now. Anyways looking close when the bar engine is updated to current latest stable |
|
@saurtron Looks like http://github.com/beyond-all-reason/Beyond-All-Reason/pull/5702 merged recently... does that unblock this PR? (Call it heresy if you will, but would commenting out most of the tests help accelerate the process, and then a follow-on PR performs the test fixes, post-merge?) (Just curious because I feel automated CI testing would be nice to see in this project.) |
|
Does this PR supersede #2626? Both PRs add the same set of Github action files. |
That precondition did not happen, bar is still on engine 2025.04.08. |
First line of this PR:
|
- rebased PR #4140 on master - removed a test for air repair pads - skipped two tests that were failing (hope that's ok so that progress can be made on getting CICD working) - In theory this should run tests in GitHub Actions (we'll see if it still works) - Sets tests to run on the "manual-linux-test-engine" engine from the release config.json - recoil_2025.06.06 - ...which still seems old relative to master... are there newer releases we should be targeting? Or is "manual-linux-test-engine" always going to be the correct one to target?
- rebased PR beyond-all-reason#4140 on master - removed a test for air repair pads - skipped two tests that were failing (hope that's ok so that progress can be made on getting CICD working) - In theory this should run tests in GitHub Actions (we'll see if it still works) - Sets tests to run on the "manual-linux-test-engine" engine from the release config.json - recoil_2025.06.06 - ...which still seems old relative to master... are there newer releases we should be targeting? Or is "manual-linux-test-engine" always going to be the correct one to target?
Work done
More details
for convenience, from #2626:
This uses https://github.com/EnricoMi/publish-unit-test-result-action to publish test results for PRs, including forks. It uses roughly the setup described here to do so. This means there is an action that runs on the PR branch that runs the tests, and an action that runs on the master branch that publishes the results.
Remarks
depends: {"gl"}at info