You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/11/12 20:43:53 UTC
[GitHub] [couchdb] kocolosk opened a new pull request #3831: Consolidate elixir targets and simplify Makefile
kocolosk opened a new pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831
## Overview
This PR is really just trying to simply our Makefile, reducing target overlap and removing unnecessary environment declarations and dependencies. I also restored `python-black` as a required check and reformatted our Python code accordingly.
## Testing recommendations
* `make check` covers everything changed here
* `make elixir-suite` has been streamlined a bit but still runs the full integration suite
* `make elixir-check-formatted`, `make elixir-credo`, and `make elixir-integration` can all be run independently. They no longer depend on `elixir-init`, so if you're working on a clean instance `mix` will ask you if you want to install rebar etc. locally (and you can just accept the default)
* `make mango-test` also saw a few small changes.
## Reviewer Guidance
The commits are meant to be reviewed individually. Most are quite straightforward, but looking at the diff in its entirety can make it more difficult to figure out some of the substance. Other noteworthy bits:
* I removed the `TEST_OPTS` variable -- does anyone use it at all? Inside the Makefile it was being used to inject some .ini config settings; I moved those to an appropriate `test-config.ini` file.
* The `suite.elixir` file was a bit outdated, so I rebuilt it. I also renamed two tests that were being accidentally excluded from the suite.
* The `skip.elixir` file was skipping several tests that actually pass, and was not excluding any tests that were not already marked with a `pending` tag. I zeroed out the skip file in this PR and left a comment that it could be used if one wanted to exclude tests without tagging them directly in the codebase.
## Discussion Topic
I find it a little janky to have to keep `suite.elixir` manually up-to-date. Should we find a way to automate that? I found quite a few instances in today's work where we were not running tests that we ought to have been running. Conversely, do we actually need to keep the suite / skip approach to managing test sets? ExUnit always has a fairly rich tagging and filtering system for constructing test sets. I wouldn't mind at all if e.g. Cloudant folks wanted to add some additional tags to tests so they could exclude / include them as needed for their internal CI setup.
## Checklist
- [x] Code is written and works correctly
- [x] Changes are covered by tests
- [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
- [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] kocolosk commented on pull request #3831: Consolidate elixir targets and simplify Makefile
Posted by GitBox <gi...@apache.org>.
kocolosk commented on pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831#issuecomment-968503673
I discovered that the module and test name are automatically [injected](https://github.com/elixir-lang/elixir/blob/79cd891eb86ecb7654a7acdb63769cfdd950a5c0/lib/ex_unit/lib/ex_unit/runner.ex#L261) as tags on each test. That means we could exclude tests by name, or exclude an entire module, but I don't think we'd be able to exclude based on a qualified `{module, test_name}` tuple.
We do have some duplicate test names in different modules but that wouldn't be too difficult to rectify.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] kocolosk commented on pull request #3831: Consolidate elixir targets and simplify Makefile
Posted by GitBox <gi...@apache.org>.
kocolosk commented on pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831#issuecomment-969170478
I'm going to merge this one now and file a separate PR if/when we reach consensus on improvements to the suite.elixir setup in #3824
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] jaydoane commented on pull request #3831: Consolidate elixir targets and simplify Makefile
Posted by GitBox <gi...@apache.org>.
jaydoane commented on pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831#issuecomment-968350014
> I find it a little janky to have to keep suite.elixir manually up-to-date.
Same.
> Should we find a way to automate that?
The default behavior of `mix` is to run all tests, so if an up to date suite.elixir would just contain the full list of tests anyhow, I don't know why we couldn't just get rid of suite.elixir and the `--include` line that references it entirely. The only case I can think of that it would be useful is when you want to define a very small set of tests to run (e.g. the quorum tests), which would be harder to do just using exclusion. But it seems like we're just using normal tags for that, so who knows.
> Conversely, do we actually need to keep the suite / skip approach to managing test sets? ExUnit always has a fairly rich tagging and filtering system for constructing test sets. I wouldn't mind at all if e.g. Cloudant folks wanted to add some additional tags to tests so they could exclude / include them as needed for their internal CI setup.
I don't remember the exact requirements that led @iilyak to the current design, but if Cloudant had the ability to add tags, we could maybe dispense with the skip approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] kocolosk merged pull request #3831: Consolidate elixir targets and simplify Makefile
Posted by GitBox <gi...@apache.org>.
kocolosk merged pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] kocolosk commented on pull request #3831: Consolidate elixir targets and simplify Makefile
Posted by GitBox <gi...@apache.org>.
kocolosk commented on pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831#issuecomment-968407344
Thanks Jay! I hadn't seen your approval before I dropped that last commit on this PR, so I can revert it for now and file it as a separate, standalone PR. I'll fix the typo as well.
The code that generates `suite.elixir` takes about 15 seconds to execute on my machine, so I'd want to see if there was a better way to optimize that before running that routine on-demand as part of a Makefile target. I think the idea of constructing a set of excludes from the contents of a `skip.elixir` file instead of generating input to the `only_test_ids` argument could be a good approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] jaydoane edited a comment on pull request #3831: Consolidate elixir targets and simplify Makefile
Posted by GitBox <gi...@apache.org>.
jaydoane edited a comment on pull request #3831:
URL: https://github.com/apache/couchdb/pull/3831#issuecomment-968350014
> I find it a little janky to have to keep suite.elixir manually up-to-date.
Same.
> Should we find a way to automate that?
The default behavior of `mix` is to run all tests, so if an up to date suite.elixir would just contain the full list of tests anyhow, I don't know why we couldn't just get rid of suite.elixir and the `--include` line that references it entirely. The only case I can think of that it would be useful is when you want to define a very small set of tests to run (e.g. the quorum tests), which would be harder to do just using exclusion. But it seems like we're just using normal tags for that, so who knows.
> Conversely, do we actually need to keep the suite / skip approach to managing test sets? ExUnit always has a fairly rich tagging and filtering system for constructing test sets. I wouldn't mind at all if e.g. Cloudant folks wanted to add some additional tags to tests so they could exclude / include them as needed for their internal CI setup.
I don't remember the exact requirements that led @iilyak to the current design, but if Cloudant had the ability to add tags, we could maybe dispense with the skip approach.
Update: I dug around in suite.ex, and I think I understand better how this works. You can't really use skip.elixir without suite.elixir because you can apparently only pass in the test ids you want to run via `only_test_ids` ExUnit config param. There's evidently no way to pass a list of ids _not_ to run, having the list of tests you want to run beforehand is necessary to use skip.elixir. The corollary is that if you can exclude all tests via tags, then neither seems necessary. Unfortunately, suite.ex doesn't currently warn if you try to use e.g. skip.elixir without suite.elixir -- it just does something surprising, and runs all tests basically ignoring skip.elixir.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org