Skip to content
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

brew tap-new: tests.yml workflow fails with casks #11507

Merged
merged 3 commits into from Jun 10, 2021
Merged

brew tap-new: tests.yml workflow fails with casks #11507

merged 3 commits into from Jun 10, 2021

Conversation

ncruces
Copy link
Contributor

@ncruces ncruces commented Jun 8, 2021

Running brew test-bot --only-tap-syntax fails on ubuntu-latest if any casks are added later to the tap, since casks are macOS only.

See github.com/ncruces/homebrew-tap for my custom tap. I've fixed this in main by adding this line (which prevents brew test-bot --only-tap-syntax from running on ubuntu-latest, but still runs it on macos-latest, which should be enough to ensure correctness).

The casks-not-supported branch reverts the change, and causes the failure.

This was my best attempt for a fix, but I'm open to suggestions and doing the necessary leg work to get them through.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Running `brew test-bot --only-tap-syntax` fails on `ubuntu-latest` if any casks are added later to the tap, since casks are macOS only.
@MikeMcQuaid
Copy link
Member

This was my best attempt for a fix, but I'm open to suggestions and doing the necessary leg work to get them through.

Thanks @ncruces! My thinking is fixing that uninitialized constant Cask::Cmd::AbstractCommand would be the best bet here; it's probably just a missing require. It may be (I'm not sure, please correct me either way @Homebrew/cask @reitermarkus) that brew audit isn't expected to work for casks on Linux in which case that would be the best fix.

@Rylan12
Copy link
Member

Rylan12 commented Jun 8, 2021

brew audit isn't expected to work for casks on Linux

I don't know about expectations but I can confirm that brew audit is never run on Linux in our CI. The syntax job that runs on ubuntu-latest in most situations only runs brew style.

@carlocab
Copy link
Member

carlocab commented Jun 8, 2021

I feel like brew test-bot --only-tap-syntax should still work on Linux, even if casks are macOS-only. Unless these tests require being able to actually extract/examine .pkg installers or .dmg files?

@ncruces
Copy link
Contributor Author

ncruces commented Jun 8, 2021

If this PR isn't the right answer (which it probably isn't), should I close it and open an issue? Feel free to do it yourselves!

I don't think I understand Homebrew well enough to contribute the actual fix, but I'm available to test it.

Thanks!

@MikeMcQuaid
Copy link
Member

I feel like brew test-bot --only-tap-syntax should still work on Linux, even if casks are macOS-only.

Agreed.

If this PR isn't the right answer (which it probably isn't), should I close it and open an issue? Feel free to do it yourselves!

We'd be happy to help point you in the right direction for this @ncruces if you'd be game to continue working on it?

@ncruces
Copy link
Contributor Author

ncruces commented Jun 8, 2021

We'd be happy to help point you in the right direction for this @ncruces if you'd be game to continue working on it?

Please do. I anticipate the workflow for a fix should be quite different (running a forked version of Homebrew, which I've successfully avoided, so far... eh). But if I feel overwhelmed, I'll say so then. Happy to help.

Running `brew audit --tap=[TAP]` fails on Linux (including GitHub Actions CI) if the tap has any caksks.
@ncruces
Copy link
Contributor Author

ncruces commented Jun 9, 2021

OK, so how about the new change? It seems to do what @MikeMcQuaid hinted at?

Not sure how I can get GitHub CI to use my forked version, but I can already run:

brew audit --tap=ncruces/tap

On both macOS and Linux. This used to fail on Linux with the same error as GitHub Actions CI.

Also did my best to run tests/style/typecheck, but it's all a first to me... didn't add any tests.

@MikeMcQuaid MikeMcQuaid merged commit d69f1a3 into Homebrew:master Jun 10, 2021
@MikeMcQuaid
Copy link
Member

Thanks so much for your contribution! Without people like you submitting PRs we couldn't run this project. You rock, @ncruces!

@ncruces
Copy link
Contributor Author

ncruces commented Jun 10, 2021

Can confirm that this fixes CI for me.
Thanks!

https://github.com/ncruces/homebrew-tap/pull/4/checks?check_run_id=2795274197

@github-actions github-actions bot added the outdated PR was locked due to age label Jul 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants