Skip to content

Conversation

ikappaki
Copy link
Contributor

Hi,

could you please consider adding a new GitHub workflow to run the cider tests on the macos platform, as to have wider test coverage, as described in #3116.

It does not appear to be possible to have a free macos executor after having a quick look at this page https://circleci.com/docs/2.0/hello-world-macos/ :

Prerequisites To follow along with this document you will need: - An account on CircleCI. - A subscription to a paid plan to enable building on the macOS executor. 

thus the switch for this particular platform to GitHub worfklow, which is free.

All tests pass on macos-latest on Emacs 27.2.

I understand this fragments the ci admin files a little, but it adds quite a lot of value.


Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • [x ] The commits are consistent with our contribution guidelines
  • [x ] You've added tests (if possible) to cover your change(s)
  • [x ] All tests are passing (eldev test)
  • [x ] All code passes the linter (eldev lint) which is based on elisp-lint and includes
  • [x ] You've updated the changelog (if adding/changing user-visible functionality)
  • [x ] You've updated the user manual (if adding/changing user-visible functionality)

Thanks!

Copy link
Member

@vemv vemv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking reasonable, thanks for the effort!

After the round of feedback could you also branch off and show that the GH workflow fails when an intentionally-failing tests fails?

version: ${{matrix.emacs_version}}

- name: Install Eldev
run: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/github-eldev | sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest using an immutable link here, reproducibility matters in CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same setup we use in CircleCI for the other architectures. I understand the concerns, this is the recommended Eldev way. On the positive side, we get constant test improvements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that one can use tagged uris e.g. https://raw.githubusercontent.com/doublep/eldev/0.10.3/webinstall/github-eldev

I think we should not be exposed to arbitrary breaking changes. It really is counterproductive to have releases botched on the last minute because CI started failing for reasons outside of our control.

It happens.

I understand the concerns, this is the recommended Eldev way.

This is an overstatement tbh, a specific instruction doesn't mean they have considered other alternatives, or that those alternatives are actively discouraged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed Eldev version to 0.10.3 as requested, all tests pass as expected.

strategy:
matrix:
os: [macos-latest]
emacs_version: ['27.2']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a good idea to exercise the same versions we do on Circle

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not waste resources on testing anything other the previous version on macos. Functionality wise, we get coverage of the older versions with the Gnu/Linux builds.

We also only test the latest version with MS-Widnows on CircleCI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to couple things - reasoning about one build shoudn't depend on another build.

And also you say:

GitHub currently appears to be quite generous with resources, which I find it absurd in the positive way. I never hit a barrier yet and have been running some serious jobs in the past.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to couple things - reasoning about one build shoudn't depend on another build.

I agree.

And also you say:

GitHub currently appears to be quite generous with resources, which I find it absurd in the positive way. I never hit a barrier yet and have been running some serious jobs in the past.

... true for Linux and Window boxes that I have most experience with (the intention of the above was meant to be a statement showing the benefits of GitHub over CircleCI btw). I've also noticed that for macos they might reclaim the box while it is running. I think they macos resources are not as abundant as with the other platforms.

Ideally yes, we should be testing the whole version matrix across all architectures, but I don't fill comfortable doing so for macos (or anything else other than Linux, i.e. having at least some very good coverage about the other versions).

Would you like me to proceed with configuring the other versions for macos as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different macos versions don't matter as much because most likely we dont have business logic that depends on macOS intricacies.

But Emacs different versions certainly matter - just today we caught something:

image

https://github.com/clojure-emacs/enrich-classpath uses an extensive GH Actions matrix and its size has never been a problem per se:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different macos versions don't matter as much because most likely we dont have business logic that depends on macOS intricacies.

But Emacs different versions certainly matter - just today we caught something:

I agree.

https://github.com/clojure-emacs/enrich-classpath uses an extensive GH Actions matrix and its size has never been a problem per se:

This is a good demonstration we can have multiple macos jobs setup running, though I would add it is also sensitive on the relative commit frequency. I've added 26.3 to to the list alongside 27.2. I suppose the intention here is to include all Emacs versions supported by Emacs? Is there another version you would like me to add? Thanks,

26.3 on macos failed as expected similarly to the Linux build:

... [00:14.805] Debugger entered--Lisp error: (void-function package-get-version) ... 
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another version you would like me to add?

I think that being on par with Circle suffice. Perhaps we can add comments in both config files, to remind us keeping the values in sync.

26.3 on macos failed as expected similarly to the Linux build:

Perfect, thanks!

@vemv
Copy link
Member

vemv commented Dec 28, 2021

From a promotional email, Circle recently said macOS for the Free tier was "coming soon".

Let's see when that actually happens, no issue in the meantime

@ikappaki
Copy link
Contributor Author

ikappaki commented Dec 28, 2021

Looking reasonable, thanks for the effort!

After the round of feedback could you also branch off and show that the GH workflow fails when an intentionally-failing tests fails?

forked and deliberately forced a test to fail, macos run log showing the failure https://pipelines.actions.githubusercontent.com/gHVz7qA3HTDgSJiU6GmuUtGcUCzIGO2SADtrOJAVfQAYQZJJpD/_apis/pipelines/1/runs/2/signedlogcontent/2?urlExpires=2021-12-28T19%3A33%3A03.5638764Z&urlSigningMethod=HMACV1&urlSignature=%2BsRO2QQhtNG%2FnRO8c3G%2FZx0%2B0kRG5TqeBoEwZTJ260U%3D

also the macos job page https://github.com/ikappaki/cider/runs/4652948439?check_suite_focus=true

2021-12-28T19:29:15.8912046Z Found online and idle hosted runner in the current repository's organization account that matches the required labels: 'macos-latest' 2021-12-28T19:29:16.0035859Z Waiting for a Hosted runner in the 'organization' to pick this job... 2021-12-28T19:29:16.1631216Z Job is waiting for a hosted runner to come online. 2021-12-28T19:29:24.8121519Z Job is about to start running on the hosted runner: Hosted Agent (hosted) 2021-12-28T19:29:27.5233060Z Current runner version: '2.285.1' 2021-12-28T19:29:27.5274440Z ##[group]Operating System 2021-12-28T19:29:27.5275790Z macOS 2021-12-28T19:29:27.5276250Z 11.6.2 2021-12-28T19:29:27.5276770Z 20G314 ... 2021-12-28T19:31:42.4493200Z ======================================== 2021-12-28T19:31:42.4494080Z cider-abbreviate-ns handles nil input 2021-12-28T19:31:42.4494450Z 2021-12-28T19:31:42.4494810Z Traceback (most recent call last): 2021-12-28T19:31:42.4496360Z buttercup-fail("%s" "Expected `(cider-abbreviate-ns \"something\")' to be `equal' to `nil', but instead it was `\"something\"' which does not match because: (different-types \"something\" nil).") 2021-12-28T19:31:42.4498500Z signal(buttercup-failed "Expected `(cider-abbreviate-ns \"something\")' to be `equal' to `nil', but instead it was `\"something\"' which does not match because: (different-types \"something\" nil).") 2021-12-28T19:31:42.4500560Z FAILED: Expected `(cider-abbreviate-ns "something")' to be `equal' to `nil', but instead it was `"something"' which does not match because: (different-types "something" nil). 2021-12-28T19:31:42.4501360Z 2021-12-28T19:31:42.4901300Z Ran 338 out of 339 specs, 1 failed, in 3.89s. ... 
@ikappaki
Copy link
Contributor Author

From a promotional email, Circle recently said macOS for the Free tier was "coming soon".

Let's see when that actually happens, no issue in the meantime

Noticed in the past cider was running out of credit with circle ci because of the accumulated number of resources used during whatever the accounting period currently is. GitHub currently appears to be quite generous with resources, which I find it absurd in the positive way. I never hit a barrier yet and have been running some serious jobs in the past.

Copy link
Member

@vemv vemv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👏

@vemv vemv merged commit 7395550 into clojure-emacs:master Dec 29, 2021
@bbatsov
Copy link
Member

bbatsov commented Dec 29, 2021

You merged this before I could comment, but I really think that if we go in this direction we should move everything to GitHub Actions, as the CI becomes a bit messy right now. One small example - how many CI badges do we need to put in the README? :-) I certainly don't want to deal with both GitHub Actions and CircleCI indefinitely.

Also some general notes:

  • I can't think of anything that can possibly work on the Linux build, but fail on the macOS build. It's not like we have some OS-specific features. All OS-specific issues have always been with Windows and the different filenames there. I'm not saying that the macOS CI is a bad idea, but I'm also not seeing which problem do we expect it to solve.
  • I'm not sure if there are some build credit limitations (I guess there are), so it might be prudent to only run this for the most recent macOS release not to consume them too quickly (as was happening with Windows builds on CircleCI in the past).
@vemv
Copy link
Member

vemv commented Dec 29, 2021

I'm not saying that the macOS CI is a bad idea, but I'm also not seeing which problem do we expect it to solve.

Probably I tend to agree but who knows which crazy problem might be caught sometime.

I'm not sure if there are some build credit limitations

Speaking of them, apparently macOS is coming to free Circle soon. That would simplify badges/proliferation. Assuming Win and Mac builds are not too different in terms of credits, macOS would keep working as long as Win builds keep working?

@vemv
Copy link
Member

vemv commented Dec 29, 2021

A related topic is that currently CI builds don't even matter much, we often see red stuff on master.

Perhaps we can refine that such that master is never red?

Btw finally I'm appreciating the frequent commits on master to be melpa-snapshotted, they certainly yields useful user feedback. But if the build was red to begin with, then we're just using people for doing CI's job 😃

So as a middle ground perhaps we could have a dev branch that would be regularly merged into master to be snapshotted if it's green.

@bbatsov
Copy link
Member

bbatsov commented Dec 29, 2021

Probably I tend to agree but who knows which crazy problem might be caught sometime.

Perhaps, I've just rarely seen projects test on macOS specifically unless they are some macOS apps. I guess part of the reason is that it's usually expensive to do so, but I assume another part is that macOS specific issues are quite unlikely. On the other hand, each extra build means more time waiting for the builds to pass.

Assuming Win and Mac builds are not too different in terms of credits, macOS would keep working as long as Win builds keep working?

Yeah, I guess so.

So as a middle ground perhaps we could have a dev branch that would be regularly merged into master to be snapshotted if it's green.

This has been proposed a few times in the past, but the real problem is that the test suite is pretty basic and rarely finds meaningful problems. (e.g. it didn't catch the problem with cider-version that happened yesterday) Admittedly, that's also the reason why I almost never bother to run it locally. A lot of time needs to be invested in backfilling tests and figuring out some meaningful way to write integration tests, so that the test suite would truly add stability to the development.

@bbatsov
Copy link
Member

bbatsov commented Dec 29, 2021

Btw, even now I'm getting different results when running the tests locally and on the CI... Two tests fail locally (probably because I'm on Emacs 29), but the test that fails on Emacs 27 passes for me. And the byte-compilation error about the unused return value from fboundp makes no sense. Go figure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants