-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bats file detik and support #4
Bats file detik and support #4
Conversation
As mentioned in #3 , not sure if detik will work we need to merge the pr to test. |
@martin-schulze-vireso , any issues with this pr that I can clear up? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run the tests in a GitHub Action?
I forgot to subscribe to notifications so I just did not see it. |
Great suggestions, I will try to get these changes in the next few days. |
Some documentation on testing taps. Some good details on how to create a tap |
the stack overflow I posted was about using travis ci. currently trying to run the tests locally with {
PACKAGE=bats-assert;
brew tap bats-core/bats-core;
brew audit $PACKAGE;
brew install -v $PACKAGE;
brew test $PACKAGE;
brew developer off;
} will report my findings shortly.
the test for bats-assert failed but then I read the documentation it looks like the tests in bats-assert are only supported when installing bats-support using npm? should the github action be on the release itself ? would make a green checkbox here: lastly the model I used as a template does not have github actions setup to breaking new ground on this which could be time consuming. |
I'd prefer to have a test before releasing to avoid releasing something broken. We don't need to run the module's selftests though. It would be sufficient to run a small test that shows we successfully loaded the dependency. |
It does not exist until it is merged to master Maybe some help is needed. |
I understood that you need an established GHA workflow on master to add your changes to it. I commited a dummy workflow to master. Just rebase and you should be good to go. |
I can help if you like and create that simple github action, will push something later today :) |
Ok I did a first working action: https://github.com/brokenpip3/homebrew-bats-core/blob/main/.github/workflows/test-brew-formulas.yaml and this is the last run: https://github.com/brokenpip3/homebrew-bats-core/runs/4245164444?check_suite_focus=true Please be aware:
@MichaelDimmitt let me know if you want a PR against your branch or you can just copy and paste from my fork. |
Just updated my branch with last @MichaelDimmitt changes, you can see the logs here: https://github.com/brokenpip3/homebrew-bats-core/runs/4249308567?check_suite_focus=true and opened the PR against Michael's fork: MichaelDimmitt#10 |
@MichaelDimmitt any news? Can I help you with something else? |
bdce279
to
567a549
Compare
Thanks @brokenpip3 for the save! I have merged in your changes and made some updates to pass the audit. I removed the continue on error for all tasks except the test actions. @martin-schulze-vireso can you take a look at the github action, are we ready to merge or are more changes needed? https://github.com/bats-core/homebrew-bats-core/runs/4457052834?check_suite_focus=true Cheers, Michael Dimmitt |
install bats as a github action add audit and test github actions specify --formula to look at formulas and not casks
5026f19
to
1fad928
Compare
squashed commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is unnecessary to run the libraries' self tests to demonstrate that the installation works.
I'd much rather have an example script for each library that uses the library.
E.g. the bats-assert example script could look something like:
setup() {
load '#{HOMEBREW_PREFIX}/lib/bats-support/load.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-assert/load.bash'
}
@test test {
assert true
}
and then try to run that in the tests.
imho the real question here is: why the standard libraries tests fail on macos? we should care about it?
this is ok for support instead for detik at the end we should do something like https://github.com/bats-core/bats-detik/blob/6ccb9f64e33d11f9658d6a38553b383225f0ccef/tests/test.detik.try.to.find.bats#L8-L22 right? |
I am currently preparing a 1.5.1 bugfix release that should solve issues I have seen with bats-assert's selftest suite. Maybe the others have the same problem. I would say that this repo/PR should not concern itself with internal test failures of those libraries tests. The objective of this repo is to facilitate installing the dependencies and the tests should check that this is working. If there is a problem with the selftests that should be solved in the respective repos (or in this case in bats-core).
Yes, we should have an extra example per library that requires usage of at least one exclusive feature of the respective library to prove that it is loaded. |
This is great, thanks!
Ok this make totally sense, I can create try to do the required changes testing it using GH actions.
Ok will try to implement it like that upstream example |
See bats-core/bats-core#522 but that only deals with issues under Linux. The 1.5.1 release will get a cherry pick of this.
Any help is welcome. I already started with bats-core/bats-assert#41 which showed the problem above. It would be good to have some automated tests on new master versions of bats-core as well. I am not sure if we should invert that and let bats-core do those integration tests in a central place. |
Ok let me move this conversation on that PR |
I resolved one of the threads, Can we post an outline of what changes are remaining for getting this pr across the finish line? |
I'd say:
|
Bats file detik and support
Ok I added all the changes requested, @MichaelDimmitt could you please approve this PR: MichaelDimmitt#11 so @martin-schulze-vireso can review my last changes? summary:
Now we should be close to merge this PR 🎉 |
Add tests as upstream request + change/fix detik path + remove continue on error
Thanks @brokenpip3 , merged your change that had the tests that he requested. Looks like we should be good for merge. @martin-schulze-vireso |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits but I won't hold this up any longer:
- is it common to put the test files into the formula instead of having them "on disk" as separate files?
- the tests seem to work but I don't see any bats output. Can we get verbose output to see if everything works as expected?
- I'd give each library its own job (maybe using a matrix?) instead of steps in the same job.
https://docs.brew.sh/Formula-Cookbook#add-a-test-to-the-formula
Ok np, Let me work on these ^ on another PR today |
Isn't this one of the features of brew to install the transitive dependency as well? |
yes but in case of new release we should install the local formula version, right? |
@martin-schulze-vireso , here are the remaining formulas