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

Consistently have "CI Green" for Lotus - (Internal improvements program) #7164

Closed
2 tasks
BlocksOnAChain opened this issue Aug 23, 2021 · 4 comments · Fixed by #7147 or #7151
Closed
2 tasks

Consistently have "CI Green" for Lotus - (Internal improvements program) #7164

BlocksOnAChain opened this issue Aug 23, 2021 · 4 comments · Fixed by #7147 or #7151
Assignees

Comments

@BlocksOnAChain
Copy link
Contributor

BlocksOnAChain commented Aug 23, 2021

We plan to deliver this as a part of our "Internal improvements day" and improve our Lotus codebase/velocity.

As we discussed, the main actions which will enable us to achieve this state, are:

@BigLep
Copy link
Member

BigLep commented Aug 24, 2021

The "bolster code coverage program" requirements are higher than the base level I belive.

Base Level Requirements

The baselevel thing we want to avoid is someone being able to submit a change on a .go source file without any accompanying tests.  Even better is to make sure the code coverage level doesn't drop.

Implementation Plan

Per @Stebalien , we can't have a rule that a given change always have >= 0% code coverage change. There is some nondeterminism in the runs. We have to go with a threshold like ≥ -.1% to account for this. Furthermore, patch-based code-coverage fails because a patch that edits a likely impossible error message/panic will always have zero coverage.

We'd need to define separate "projects" in our codecov config for each lotus subsystem package (ish, use discretion). Each project would have:

  1. The target set to auto. This will make codecov "hold" the current coverage.
  2. A threshold of 0.1%. Looking at our tests, I see code coverage go up and down by about due to noise 0.07% so 0.1% shouldn't fail. If it becomes a problem, we can tune this value for "noisy" sub-projects.
  3. informational set to true if we want coverage to pass regardless. This will most likely be useful for cli and maybe api, where a lot of code is boilerplate or CLI commands that won't be covered by unit tests. NOTE: we often just ignore these directories, but informational coverage is likely better.

@BigLep
Copy link
Member

BigLep commented Aug 24, 2021

It would be ideal to say that all new code had 70+% coverage, but there are going to be exceptions to this (e.g., 1. It's hard to ask contributors to write regression tests for one-line fixes in untested code. 2. Sometimes testing a case is non-trivial. Ideally, we'd go and write the test anyways. But when the bug is a really low priority (e.g., random community patch, random panic in some nearly impossible edge-case, etc.), this can be hard to prioritize.). Given the focus right now is to establish the mindset that "we only merge if the CI is green", we're biasing towards not enforcing new code must have higher coverage so as to avoid exceptions. Code reviewers will have the code coverage report data and can request coverage as needed. This is admittedly a best intention, but we're trying to establish some reliable foundation before we ratchet up.

@Stebalien
Copy link
Member

Ok, so most of CI is green now. Except that I re-enabled the testrgound tests (because the infrastructure was fixed) and now we're seeing a test failure: #7186.

@BlocksOnAChain
Copy link
Contributor Author

closing since we have been in the "green" status for some time now.

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