zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.83k stars 6.6k forks source link

tests: posix: common: separate into smaller testsuites #79454

Open cfriedt opened 1 month ago

cfriedt commented 1 month ago

Is your enhancement proposal related to a problem? Please describe. The posix.common testsuite contains a lot of mostly unrelated testsuites. As a result, the code size is large, but mostly the data size is extremely large.

It would require less variation from default settings, and would reduce ram requirements to split that testsuite into smaller groups of more closely related testsuites.

Describe the solution you'd like

The obvious way to group related testsuites is by Option Group.

E.g.

and potentially others.

testcase.yaml permutations can be designed to enable or disable features specific to one Option Group, like TSS, TSA, TSH (see Codes).

Additionally, such a grouping would theoretically improve bug attribution capabilities; if an error was traced (either via stacktrace or bug description) to a certain posix function, there would be a 1:1 correspondance to an Option Group, so typically, only that testsuite would need to be executed.

Describe alternatives you've considered The way the testsuite has been designed historically.

Additional context This came up in the context of #79443 but it was already thought of as a nice-to-have.

zacck commented 1 month ago

Can I take a stab at this one please, if it's ok could it be assigned to me?

cfriedt commented 1 month ago

@zacck - please do!

zacck commented 4 weeks ago

@cfriedt I'm new to Zephyr and while I have looked at the links and docs supplied above I believe I need an example to start breaking this down would you be able to assist with some information that would help here?

ycsin commented 4 weeks ago

@zacck If you have just started with Zephyr, I think you will need to be familiarized with Twister and the different KV pairs in the testcase.yaml, see Test Runner (Twister)

@cfriedt do you expect the zephyr/tests/posix/common test to be broken down into multiple tests? Because while we can break the test into multiple sub-tests within the tests/posix/common/testcase.yaml, the existing testcase.yaml would be pretty big when we want to make sure that each sub-test are tested with different configurations (different C libs, spin validation, tls, ...) that we have: (<number of option group sub-test> x <number of configurations>)

cfriedt commented 4 weeks ago

@cfriedt do you expect the zephyr/tests/posix/common test to be broken down into multiple tests?

They should be broken down into separate app directories.

That's mainly because the single application is getting quite large, and the configuration requirements are not always clear.

It would be better if the prj.conf and memory requirements were minimal.

cfriedt commented 3 weeks ago

It could be good to split this into smaller commits / a task list.

zacck commented 3 weeks ago

@cfriedt yeah breaking this down would be awesome, I am going to do that once I have a solid plan ahead which should be around tomorrow 16th OCT 24.

cfriedt commented 3 weeks ago

@cfriedt yeah breaking this down would be awesome, I am going to do that once I have a solid plan ahead which should be around tomorrow 16th OCT 24.

Cool - it can be separate PRs, which should simplify things. I'll do pthreads, because it is likely the most confusing.

zacck commented 3 weeks ago

@cfriedt yeah breaking this down would be awesome, I am going to do that once I have a solid plan ahead which should be around tomorrow 16th OCT 24.

Cool - it can be separate PRs, which should simplify things. I'll do pthteads, because it is likely the most confusing.

It might be more beneficial if you teach me how to do the most confusing parts, that way I and others can grow into being able to help with meatier stuff and contributors like you can get more done since you can effectively direct us.

I do understand that is would be slower and cumbersome, but do consider it enables us to help more.