Skip to content
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

refactor unit testing framework to have less need for allow #1148

Open
Licenser opened this issue Jul 26, 2021 · 10 comments
Open

refactor unit testing framework to have less need for allow #1148

Licenser opened this issue Jul 26, 2021 · 10 comments
Labels
_complexity:low A task with a low complexity that should be easy to understand enhancement New feature or request good first issue Good for newcomers hacktoberfest _size:medium A medium sized task that will take some time to complete

Comments

@Licenser
Copy link
Member

Describe the problem you are trying to solve

The unit testing framework uses a large number of arguments in most of it's functions, this can be unwieldy and easy to get wrong. This is highlighted by the need to have a large number of allow statements that circumvent the clippy lints.

Describe the solution you'd like

Refactor the function signatures by grouping repeated data together. A starting point could be to group

    suite_tags: &test::TagFilter,
    sys_filter: &[&str],
    includes: &[String],
    excludes: &[String],

Into a shared struct that can be re-used over functions. This might apply to other parts of the CLI as well.

As an additional bonus this reduces the risk of mistakes by accidentally swapping parameters with similar types but different meanings (like includes and excludes)

@Licenser Licenser added enhancement New feature or request good first issue Good for newcomers _complexity:low A task with a low complexity that should be easy to understand _size:medium A medium sized task that will take some time to complete labels Jul 26, 2021
@afzal442
Copy link

Hi @Licenser, looking into it!

@Licenser
Copy link
Member Author

Awesome :)

some of it (unit tests) have been touched in #1143 that might give an idea on how to go about it

@afzal442
Copy link

Thanks @Licenser, lemme see and work around it.

@Licenser
Copy link
Member Author

Awesome :) it can get a bit tricky with lifetimes and figuring out which inputs can be grouped together if you have a plan and want to run it by someone or need a hand feel free to reach out.

@Licenser
Copy link
Member Author

Licenser commented Aug 5, 2021

Heya @afzal442 I just wanted to check in how things are going and if you could use help with anything?

@afzal442

This comment has been minimized.

@afzal442
Copy link

afzal442 commented Aug 5, 2021

thanks I just had a connection with @mfelsche. he helped me how to debug that unit testing on vscode, etc.

@Licenser
Copy link
Member Author

Licenser commented Aug 5, 2021

That's always a bit tough since we're all working, it's best and generally preferred to post questions in a forum like this or the general chat so it's easier for others to comment/learn from and get involved. It also prevents knowledge silos which is quite important in a large project like tremor, what happens in a voice chat is lost after the end, what happens in text in an open forum like the ticket is saved for later.

@afzal442
Copy link

afzal442 commented Aug 5, 2021

it's best and generally preferred to post questions in a forum

Yep r8! I agree with you.

That's always a bit tough since we're all working

But I was interested in this issue by looking at the label as gfi.

@Licenser
Copy link
Member Author

Licenser commented Aug 5, 2021

It is, it's a fairly self-contained issue that doesn't require a deep understanding of the system or rust. And we're generally happy to help, but it doesn't change the fact that we also have other responsibilities throughout the day. We try to make time where we can but we can't just drop everything at any particular time.

So as explained above, asynchronous communication, with all the other benefits, is the most efficient way as we can take the 15 minutes we have here and there to help out. And, as explained above as well, it allows someone else to hope in and help that might have an easier time on that day :).

Otherwise, we have open office hours every second Tuesday of the month you can look at the schedule here https://community.cncf.io/tremor-community/

@afzal442 afzal442 removed their assignment Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
_complexity:low A task with a low complexity that should be easy to understand enhancement New feature or request good first issue Good for newcomers hacktoberfest _size:medium A medium sized task that will take some time to complete
Projects
None yet
Development

No branches or pull requests

3 participants