-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[RFC] tests: group applications in subdirectories #15358
Conversation
As a new user, looking at the tests for possible examples, I would wonder, what Another problem I see with the current hierarchy (but also my own proposal) is that tests that should be together (because they are very similar and might become one application at some point in the future) are split up. The perfect example that comes to mind for me are the |
Then we could rename this category
The problem I see is the tree depth that would increase. We should find a good trade-off between tree depth and the number of applications at a given level. I think we all agree that the situation in master is not good (427 directories in
I agree that some applications could be merged but this is orthogonal to this PR. I also think that we should keep in mind that it's important to have good and visible examples for end-users. Keeping a detailed application for each |
20c1932
to
0b20ad5
Compare
This is probably the best in the current situation. After continuing the work on this PR I came up with the following subdirectories: |
0b20ad5
to
04db28d
Compare
Since a lot of test files are touched by this PR, a lot of static tests are failing (cppcheck, coccinelle, flake8, etc...). Even worse, running the static tests takes +7 minutes locally (cppcheck is very slow), and this times out on Murdock. |
Maybe split it up in multiple PRs then? |
The |
looks at @benpicco |
04db28d
to
4c94a42
Compare
This is certainly how it will end up. Reviewing a 2k files changed and |
4c94a42
to
08fd4b5
Compare
Not to mention various rebases, due to PRs getting merged, while this review is happening :-/ |
08fd4b5
to
49d1afd
Compare
66b6ca1
to
152b72c
Compare
I see a potential drawback related to CI this PR: if a contributor put a test application in a subdirectory that is not listed in |
That is basically already a problem, when an application is not in |
makefiles/app_dirs.inc.mk
Outdated
EXAMPLES_APPLICATIONS_SUBDIRS := \ | ||
ble \ | ||
coap \ | ||
cord \ | ||
dtls \ | ||
gnrc \ | ||
icn \ | ||
lora \ | ||
mqtt \ | ||
posix \ |
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.
EXAMPLES_APPLICATIONS_SUBDIRS := \ | |
ble \ | |
coap \ | |
cord \ | |
dtls \ | |
gnrc \ | |
icn \ | |
lora \ | |
mqtt \ | |
posix \ | |
EXAMPLES_APPLICATIONS_SUBDIRS := $(shell ls -d examples/) |
Why not just do this? This would prevent something like that.
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 the idea is to limit calls to external shell commands as it's less efficient than pure make code.
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.
Ok, then... why not
EXAMPLES_APPLICATIONS_SUBDIRS := \ | |
ble \ | |
coap \ | |
cord \ | |
dtls \ | |
gnrc \ | |
icn \ | |
lora \ | |
mqtt \ | |
posix \ | |
EXAMPLES_APPLICATIONS_SUBDIRS := $(dir $(wildcard examples/*/)) |
...
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.
With the proposed solution, you would get unwanted directories listed (in examples/bindist for instance, but not only):
- this PR:
$ make info-applications | wc -l
494
- your suggestion
$ make info-applications | wc -l
496
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.
Then maybe
$(filter-out $(dir $(wildcard examples/*/Makefile)),$(wildcard examples/*/))
to get all subdirectories of examples that do not contain a Makefile (which the grouping dirs would all not)?
coap \ | ||
cord \ | ||
dtls \ | ||
gnrc \ |
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 this could change with the discussion below, but I'm not sure if adding gnrc
here instead of ipv6
, udp
is a good idea. I expect that most newcomers would try to search for those and gnrc
doesn't say too much unless someone uses RIOT beforehand.
For instance, where would we put GNRC LoRaWAN? gnrc
? lora
?
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.
Sorry, I just saw #15358 (comment).
But in any case, I still think it would be better to have a more "functional" name than gnrc
here. All the examples mentioned in #15358 (comment) have different categories (gnrc_border_router
is a border router, gnrc_networking_mac is just using one MAC layer, etc).
I think it would make sense something like:
- border_routers
- gnrc_border_router
- openthread_ncp (coming soon)
- ieee802154
- lwmac
- gomac
- submac
- netif
- gnrc_networking
or something like that
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.
Keep in mind that one day some applications in the tests might arrive in the examples
directory. The current proposal is a way to organize the "storage" of applications in the repo. How well it's organized is not so important IMHO and it will be difficult to find an organization that fits with the diversity of applications. In the long term, what would be beneficial is to add another layer of documentation (using Sphinx, who knows) where example applications could be referenced in different categories (networking, lorawan, gnrc => gnrc_lorawan, etc) but the application would remain stored in the examples/lorawan
, because it's the most obvious category.
I fear that it will be impossible to find an organization that fits everyone vision and that this discussion will be endless.
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.
ok, I see your point and agree. I also agree that this wouldn't replace documentation
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 fear that it will be impossible to find an organization that fits everyone vision and that this discussion will be endless.
I agree here, a first step is having an organization, moving that organization around should be easier once the initial change is in.
db3d481
to
886cc8d
Compare
886cc8d
to
7ea6ad5
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Still of interest for me. I think I'll rebase and split this PR into smaller chunks. |
# List all available applications | ||
include $(RIOTMAKE)/app_dirs.inc.mk | ||
|
||
ifeq (,$(filter $(APPDIR),$(APPLICATION_DIRS_ABSOLUTE))) |
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.
Wouldn't this be screaming in the face of every user of an application built out of tree?
I'm closing this since the work is being done somewhere else and this PR is quite outdated. |
Contribution description
This PR slightly adapts the
makefiles/app_dirs.inc.mk
in order to declare lists of subdirectories that can contain applications. This change is applied to thetests
directory where thebench
,cpp
,drivers
,gnrc
,periph
,pkg
,thread
,xtimer
andztimer
subdirectories are introduced.Application name prefix are also removed, since they are not redundant (
gnrc_
,driver_
, etc).Some changes were also required in each application Makefile:
=>
The application is relatively one level lower compared to the common tests Makefile, so this had to be adapted.
This PR is marked as RFC because I think some discussion is needed regarding how to group applications.
In the current state, a preliminary set of groups is defined because I found them the most obvious. Maybe we could also define other groups (like sys ?).
This PR could also be a starting work to group example applications into categories (network, basic, etc) and maybe some test applications (in drivers and/or pkg) could be moved to the examples applications.
All this needs discussion and if we can reach some agreement, the remaining work could be done in follow-up PRs (a tracking issue could be worth I think).
Testing procedure
Issues/PRs references
similar to #9933 (and maybe some ideas from there could be reused)
loosely related to #5105