julia-runtest icon indicating copy to clipboard operation
julia-runtest copied to clipboard

Add test_arg input and populate to test_args in test()

Open sschlenkrich opened this issue 2 years ago • 4 comments

This PR aims at increasing flexibility for running Julia tests. The string value of the new test_arg input is passed to test and can be accessed in Julia via the ARGS variable.

Use cases are, for example, distinuishing runs of fast and slow tests.

sschlenkrich avatar Feb 27 '23 09:02 sschlenkrich

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (d0c4f09) to head (ed29cc7).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #73   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            2         2           
=========================================
  Hits             2         2           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 27 '23 09:02 codecov[bot]

Is there anything blocking the PR? I would also find the functionality helpful.

I see the in #39 there was a concern about adding too many additional keyword args, but this seems like a very basic piece of functionality.

adamslc avatar Jun 29 '23 19:06 adamslc

I would also find this functionality useful, thanks for filing the PR!

willow-ahrens avatar Jun 07 '24 01:06 willow-ahrens

I rebased my changes on the current main branch. Hopefully, this gives another impuls for a review of this PR.

sschlenkrich avatar Jun 07 '24 16:06 sschlenkrich

I would very much like to see this merged, test_args is a standard part of how Pkg.test operates, and would be great to have the Action support it.

Could we get this to support multiple test_ags, since Pkg.test supports that too? You could leverage Julia's own arg parsing by, in the action.yml, passing inputs as julia test.harness.jl {{ inputs.test_args }}, and then calling Kwargs.kwargs with test_args=ARGS. I think using ARGS would be very natural here, because what Pkg.test does is it makes the test_args available to runtests.jl as ARGS. I'm happy to make a PR into this PR too if that's helpful.

mhauru avatar Jul 19 '24 15:07 mhauru

Thanks @mhauru for your comment. Yes, I am totally fine if you add/amend to my PR.

To be honest, I am a little bit reluctant to put to much effort in this PR by myself. This PR is open for quite a while. But the maintainers did not find the time for a review.

sschlenkrich avatar Jul 20 '24 12:07 sschlenkrich

Sorry your PR was opened in a period of low maintenance and it fell down in attention. Please feel free to bump when the PR is considered ready again for review/merge.

IanButterworth avatar Jul 20 '24 12:07 IanButterworth

Thanks @IanButterworth for your comment! I rebased my proposed changes on the latest main branch. From my perspective this PR is ready for review. Could you have a look?

I would suggest to first integrate this PR and then @mhauru could add support for multiple arguments.

sschlenkrich avatar Jul 22 '24 18:07 sschlenkrich

Documentation and example is a fair point. I just added a paragraph to the readme. @IanButterworth, could you have a look if this works for you?

sschlenkrich avatar Jul 22 '24 19:07 sschlenkrich

@mhauru please go ahead and PR the multiple args work and we can make a release after that

IanButterworth avatar Jul 23 '24 11:07 IanButterworth