Skip to content

Events directory restructuring #13183

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

Closed
wants to merge 9 commits into from

Conversation

gpsimenos
Copy link
Contributor

@gpsimenos gpsimenos commented Jun 24, 2020

Summary of changes

mbed-os/events directory restructured according to the internal proposal.

  • Public headers moved into mbed-os/events/events folder
  • Include paths updated where necessary
  • Unit tests moved into mbed-os/events/test/unit folder

This is the first in a series of PRs aiming to clean up the mbed-os directory structure. The intention is to create a consistent tree among mbed components which following the below structure:

[component name]
├── mbed_lib.json                  
├── [component name]               <- Public headers that can be accessed by the developers
│   ├── [public header 1].h 
|   └── [...]
├── internal                       <- Internal headers, available only inside Mbed OS sources
│   ├── [internal header 1].h
|   └── [...]
├── test                          
│   ├── <test suite one>
|   └── [...]
└── source                         
    ├── [source file 1].cpp
    └── [...]

Impact of changes

None

Migration actions required

None


Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@evedon


@mergify mergify bot added the needs: work label Jun 24, 2020
@evedon
Copy link
Contributor

evedon commented Jun 24, 2020

The greentea tests should be moved under events/ as well

@evedon
Copy link
Contributor

evedon commented Jun 24, 2020

For consistency we should also move the local tests from the source directory to events/test.

@ciarmcom ciarmcom requested review from evedon and a team June 24, 2020 11:00
@ciarmcom
Copy link
Member

@gpsimenos, thank you for your changes.
@evedon @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-test @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@gpsimenos
Copy link
Contributor Author

@0xc0170 Can you please remove 'needs: review' label for now

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

@gpsimenos hope this removes it

@0xc0170 0xc0170 removed request for a team June 24, 2020 11:17
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 24, 2020

Travis job for checking mbed.h include in this repo needs an update to follow the changing name of unit tests (test/unit).

@mbed-ci
Copy link

mbed-ci commented Jun 25, 2020

Test run: SUCCESS

Summary: 7 of 7 test jobs passed
Build number : 1
Build artifacts

@ladislas
Copy link
Contributor

I'm really happy to see this change in directory structure! Does this mean that all unit tests will move to this new structure for their respectives components?

Regarding naming path, I'm wondering if using unity is "too specialized". What if we change the unit test framework to something else? My $0.02 is that just using unit makes it clear it's unit tests and allows for framework switch if needed.

@hugueskamba
Copy link
Collaborator

hugueskamba commented Jun 25, 2020

Regarding naming path, I'm wondering if using unity is "too specialized". What if we change the unit test framework to something else? My $0.02 is that just using unit makes it clear it's unit tests and allows for framework switch if needed.

This is also what I was going to say. So +1 for naming it unit instead of unity.

@hugueskamba
Copy link
Collaborator

I see you have events/test/unit/ and events/test/unity/. What do they each contain?

@hugueskamba
Copy link
Collaborator

Why don't we have

[component name]
├── mbed_lib.json                  
├── [public header 1].h
├── [public header 2].h
├── internal                       <- Internal headers, available only inside Mbed OS sources
│   ├── [internal header 1].h
|   └── [...]
├── test                          
│   ├── <test suite one>
|   └── [...]
└── source                         
    ├── [source file 1].cpp
    └── [...]

Having public headers inside in component_name/component_name/ feels a bit weird.
Can you explain why they are not simply in component_name/?

@gpsimenos
Copy link
Contributor Author

gpsimenos commented Jun 26, 2020

I see you have events/test/unit/ and events/test/unity/. What do they each contain?

events/test/unity/ contains unit tests previously in the UNITTESTS top-level folder.
events/test/unit/ contains "local" unit tests previously in events/source.

@gpsimenos
Copy link
Contributor Author

Why don't we have

[component name]
├── mbed_lib.json                  
├── [public header 1].h
├── [public header 2].h
├── internal                       <- Internal headers, available only inside Mbed OS sources
│   ├── [internal header 1].h
|   └── [...]
├── test                          
│   ├── <test suite one>
|   └── [...]
└── source                         
    ├── [source file 1].cpp
    └── [...]

Having public headers inside in component_name/component_name/ feels a bit weird.
Can you explain why they are not simply in component_name/?

It has been agreed to follow the yotta directory structure for components going forwards. In the yotta structure, public headers are located in component_name/component_name/.

@gpsimenos
Copy link
Contributor Author

gpsimenos commented Jun 26, 2020

I'm really happy to see this change in directory structure! Does this mean that all unit tests will move to this new structure for their respectives components?

Regarding naming path, I'm wondering if using unity is "too specialized". What if we change the unit test framework to something else? My $0.02 is that just using unit makes it clear it's unit tests and allows for framework switch if needed.

I agree. Will change unity back to unit and find an alternative name for the "local" unit tests.

Unfortunately the naming has already been signed off. Currently, the only framework used for those tests is unity, and the name is indeed "specialized", but it can be changed when/if tests using additional frameworks are added or the existing tests are ported.

@evedon evedon closed this Jul 1, 2020
@evedon
Copy link
Contributor

evedon commented Jul 1, 2020

Closing for now as this is not ready.

@mergify mergify bot removed the needs: work label Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants