WIP use GH action to detect which service tests to run; also run [packagist] #5129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refs #2545
refs #1936
I've been using github actions a fair bit on some other projects and I thought I'd revisit this idea.
The implementation I've got so far continues to allow us to specify tests to run in the PR title (as we do now). This is mainly useful for dependabot PRs where we aren't modifying any service or test code but still want to run some service tests.
It also uses the GH actions API to detect any
services/**/*.(service|tester).js
files modified and attempts to run relevant service tests based on the path. At the moment, the way I'm doing this is fairly accurate, but I've realised that there are some cases where there's a bit of a mismatch between the directory names and service/tester names. For exampleSubredditSubscribers
lives in/reddit
, most of the tester names don't contain the-
character, exceptsnap-ci
andf-droid
, which do. Also some of the services that only export a redirector don't match with the path name. One thing we could do is rename some stuff to make it more consistent, but there's not really anything to stop further discrepancies appearing in future.I think if we want to take this approach forward, what I'll probably do is write a second test loader that works based on providing paths and then use that to make this more reliable (but retain the current name-based loading for services specified in the PR title). This is a bit more involved though, so I figured I'd get some feedback on the WIP before I embark on that journey. There will also be some work on:
to fully finish this..
Thoughts?
The service tests running on this PR are arbitrary - its just to demonstrate the action actually running some tests