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

Automated test focus / skip #2203

Open
2 tasks done
fedepaol opened this issue Dec 6, 2023 · 8 comments
Open
2 tasks done

Automated test focus / skip #2203

fedepaol opened this issue Dec 6, 2023 · 8 comments

Comments

@fedepaol
Copy link
Member

fedepaol commented Dec 6, 2023

Is your feature request related to a problem?

A new contributor might find daunting that when we run e2e we run ALL The tests, whereas what we run depends on the bgp mode and on the ip family (and on having or not prometheus there).

Describe the solution you'd like

I envision a mode we run dev-env with that checks the bgp type, the ip family and what else and provides the right focuses.
This has to be an opt-in feature. We want the CI to run with specific focuses that are hardcoded and driven from outside to avoid starting to have volkswagen tests (https://github.com/auchenberg/volkswagen)

We should document this new mode and promote it as the default when developing locally.

Additional context

No response

I've read and agree with the following

  • I've checked all open and closed issues and my request is not there.
  • I've checked all open and closed pull requests and my request is not there.
@fedepaol fedepaol changed the title Document which tests one should run and how Automated test focus / skip Dec 6, 2023
@fedepaol
Copy link
Member Author

fedepaol commented Dec 6, 2023

An easier way would be to panic in inv e2etest if no focus is provided, and print out the table of focus-es we need depending on the environment

@sbshah97
Copy link

sbshah97 commented Jan 7, 2024

How do we go about this task?

@fedepaol
Copy link
Member Author

Hey @sbshah97 , I changed my mind when writing this, and instead of automation, we could go simpler and do the following

Something along the line of:

  • ipv4 - frr - no prometheus | SKIP="FRRK8S-MODE|IPV6|DUALSTACK"

and so on.

This should help first time contributors in understanding what should they do when they want to test MetalLB locally.

@fedepaol
Copy link
Member Author

@sbshah97 are you interested in working on this?

Additionally, it would make sense to maintain / build the list of skips in a single configuration file that is used both by CI and by the aforemenitioned logic.

@roopeshsn
Copy link

Hi, @fedepaol! I am interested in working on this issue. I am a first-time contributor to MetalLB. As of my understanding after reading your above comments, running inv e2etest with the skip flag (inv e2etest --skip BGP) should fail, right? and a table of tests that should be skipped based on the environment should be outputted. In the CI for E2E, it seems that the tests are skipped based on bgp-type and ip-family flags. Could you clarify on this?

@fedepaol
Copy link
Member Author

Hi, @fedepaol! I am interested in working on this issue. I am a first-time contributor to MetalLB. As of my understanding after reading your above comments, running inv e2etest with the skip flag (inv e2etest --skip BGP) should fail, right?

Nope, it should fail if you don't pass any skips

and a table of tests that should be skipped based on the environment should be outputted. In the CI for E2E, it seems that the tests are skipped based on bgp-type and ip-family flags. Could you clarify on this?

Basically, there are some tests that are relevant only for the bgp implementation (we have a native one, an FRR based one and soon an FRR-K8s based one). Some other are valid only for IPv4, or IPv6.
That's reflected in inv dev-env parameters, and we want to skip the tests that are not relevant for the current deployment (and make the user aware).

Hope this helps

@roopeshsn
Copy link

roopeshsn commented Jan 24, 2024

Hi, @fedepaol! I am interested in working on this issue. I am a first-time contributor to MetalLB. As of my understanding after reading your above comments, running inv e2etest with the skip flag (inv e2etest --skip BGP) should fail, right?

Nope, it should fail if you don't pass any skips

and a table of tests that should be skipped based on the environment should be outputted. In the CI for E2E, it seems that the tests are skipped based on bgp-type and ip-family flags. Could you clarify on this?

Basically, there are some tests that are relevant only for the bgp implementation (we have a native one, an FRR based one and soon an FRR-K8s based one). Some other are valid only for IPv4, or IPv6. That's reflected in inv dev-env parameters, and we want to skip the tests that are not relevant for the current deployment (and make the user aware).

Hope this helps

Yep, this helps! So if I am executing the command inv e2etest, the command should fail and print a table with relevant and skipped tests. By seeing that table, the user can be aware of how to execute the relevant tests using the focus and skip flags.

If I am not using BGP mode, then the tests native, frr, and frr-k8s should be printed under the skipped tests. Correct me if I am wrong.

My other doubt is: how can I check whether the user is using L2 or BGP mode? Should I check whether one of the custom resources BGPAdvertisement or L2Advertisement is applied? @fedepaol

@roopeshsn
Copy link

Hi, @fedepaol! I am interested in working on this issue. I am a first-time contributor to MetalLB. As of my understanding after reading your above comments, running inv e2etest with the skip flag (inv e2etest --skip BGP) should fail, right?

Nope, it should fail if you don't pass any skips

and a table of tests that should be skipped based on the environment should be outputted. In the CI for E2E, it seems that the tests are skipped based on bgp-type and ip-family flags. Could you clarify on this?

Basically, there are some tests that are relevant only for the bgp implementation (we have a native one, an FRR based one and soon an FRR-K8s based one). Some other are valid only for IPv4, or IPv6. That's reflected in inv dev-env parameters, and we want to skip the tests that are not relevant for the current deployment (and make the user aware).
Hope this helps

Yep, this helps! So if I am executing the command inv e2etest, the command should fail and print a table with relevant and skipped tests. By seeing that table, the user can be aware of how to execute the relevant tests using the focus and skip flags.

If I am not using BGP mode, then the tests native, frr, and frr-k8s should be printed under the skipped tests. Correct me if I am wrong.

My other doubt is: how can I check whether the user is using L2 or BGP mode? Should I check whether one of the custom resources BGPAdvertisement or L2Advertisement is applied? @fedepaol

Hi, @fedepaol! If this point is clear, I'll get started working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants