Skip to content

Extract code coverage jobs into separate CI workflow #236

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

Open
wants to merge 4 commits into
base: TDE_REL_17_STABLE
Choose a base branch
from

Conversation

artemgavrilov
Copy link
Collaborator

@artemgavrilov artemgavrilov commented Apr 18, 2025

Extract code coverage jobs into separate CI workflow and simplify it. Remove variables as we want to run this workflow only once as code coverage results don't depend on OS and build system. Also use only one job to avoid build artifact upload/download.

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.10%. Comparing base (f3719a7) to head (463ebd2).

❌ Your project status has failed because the head coverage (76.10%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           TDE_REL_17_STABLE     #236      +/-   ##
=====================================================
+ Coverage              76.07%   76.10%   +0.03%     
=====================================================
  Files                     22       22              
  Lines                   2449     2448       -1     
  Branches                 385      384       -1     
=====================================================
  Hits                    1863     1863              
  Misses                   513      513              
+ Partials                  73       72       -1     
Components Coverage Δ
access 72.41% <ø> (ø)
catalog 86.34% <ø> (+0.10%) ⬆️
common 92.50% <ø> (ø)
encryption 71.90% <ø> (ø)
keyring 69.87% <ø> (ø)
src 52.80% <ø> (ø)
smgr 96.96% <ø> (ø)
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@artemgavrilov artemgavrilov marked this pull request as ready for review April 18, 2025 15:45
run: ci_scripts/setup-keyring-servers.sh

- name: Test postgres with TDE to generate coverage
run: ci_scripts/make-test-tde.sh --continue --tde-only
Copy link
Collaborator

Choose a reason for hiding this comment

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

this doesn't have to be make-test-tde.sh, make-test is enough (and better) if we only want to run pg_tde tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I didn't get why it's better. Isn't make-test-tde.sh --continue --tde-only runs exactly only tde tests?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, but it also sets up global tde settings for all testcases, and that's not ideal for pg_tde specific tests. We are only using that to make sure that the entire regression test suite can be executed with pg_tde.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dutow, Please help me understand the difference between 'make test' and 'make-test-tde'?

As I understand, make-test is for verification of the community server/vanilla behavior with heap access method using check-world. Meanwhile, 'make-test-tde.sh' is used to verify the PSP server using the 'tde_heap' access method and pg_tde, and we use installcheck-world here.

Copy link
Collaborator

@dutow dutow Apr 18, 2025

Choose a reason for hiding this comment

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

Yes, that's the difference.

But --only-tde only runs the tests for pg_tde. In that case, we do not need make-test-tde, in fact, it is worse, because that means we are starting the pg_tde tests with tde setup even before the tests start executing, and that's not ideal there.

Adding this option to the tde test script was incorrect, that option should be part of the normal make-test script, or not even part of these scripts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So, if I understood you correctly, we have an additional step ci_scripts/configure-tde-server.sh for make-test-tde, which calls ci_scripts/tde_setup_global.sql for setting up a server for the tde_heap access method. And you don't want to set it up before if we intend to execute the pg_tde test suite only; instead, just use ci_scripts/tde_setup.sql.

Then, why are we running the pg_tde test suite with check-world, where our primary goal is to verify the vanilla server behavior for just the 'heap' access method? Shouldn't pg_tde be disabled for 'heap' access method with check-world?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe I'm missing something concerning the setup with heap/tde_heap vs check-world/install-check/install-check. I will catch up with you.

Copy link
Collaborator Author

@artemgavrilov artemgavrilov Apr 22, 2025

Choose a reason for hiding this comment

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

As I understood situation, we have two test tracks:

  1. Run ordinary tests for world (test job in CI)
  2. Run world tests on preconfigured PG with tde_heap as default access method (test_tde)

But for code coverage we want to run only TDE tests on PG with heap AM (default).

Jobs naming a little bit confusing, so I changed it a little bit

Copy link
Collaborator

@jeltz jeltz Apr 22, 2025

Choose a reason for hiding this comment

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

Yes, skipping the pg_tde tests when running make-tde-test.sh would make sense and would remove the need to the alternate result files. But that is the subject for another PR.

@@ -1,4 +1,5 @@
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com./percona/pg_tde/badge)](https://scorecard.dev/viewer/?uri=github.com./percona/pg_tde)
[![codecov](https://codecov.io/github/percona/postgres/graph/badge.svg?token=Wow78BMYdP)](https://codecov.io/github/percona/postgres)
Copy link
Collaborator

Choose a reason for hiding this comment

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

While it makes more sense to keep it here, this is also more hidden, I'm not sure if it's a good idea or bad.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then we can keep in main readme but mention that it's just tde coverage pg_tde coverage: <badge>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about this?
Screenshot 2025-04-18 at 19 07 06

Copy link
Collaborator

Choose a reason for hiding this comment

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

Something like Code Coverage (pg_tde): <Badge> or Code Coverage for pg_tde: <Badge> will look better. But not a big deal. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed
Screenshot 2025-04-22 at 16 12 27

@dutow
Copy link
Collaborator

dutow commented Apr 18, 2025

I also wanted to create an improvement PR for this, as the current huge list of skipped test just adds to much noise to the CI report.

My idea was to use specific scripts instead (coverage-build, coverage-test), and add it properly to the matrix, and changing the if skip logic to exclude so it doesn't show up - but maybe this approach is better, as the duplication is only in the calls to the scripts. And we can improve it further in the future by moving some of it into a composite action or something.

@Naeem-Akhter
Copy link
Collaborator

I also wanted to create an improvement PR for this, as the current huge list of skipped test just adds to much noise to the CI report.

My idea was to use specific scripts instead (coverage-build, coverage-test), and add it properly to the matrix, and changing the if skip logic to exclude so it doesn't show up - but maybe this approach is better, as the duplication is only in the calls to the scripts. And we can improve it further in the future by moving some of it into a composite action or something.

Yeah, there is less noise, and I also wanted to have a separate job for Coverage, just like this; however, somehow I was under the impression that we could not go beyond matrix, psp-matrix, and reusable.

@artemgavrilov artemgavrilov changed the title [Proposal] Extract code coverage jobs into separate CI workflow Extract code coverage jobs into separate CI workflow Apr 22, 2025
run: ci_scripts/ubuntu-deps.sh

- name: Build postgres
run: ci_scripts/make-build.sh debug --enable-coverage
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this also have a --continue flag? Otherwise a failing test will also result in a lower coverage, because the test stops early.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I assume you talking about make-test, not make-build. If some test failed coverage report would not be uploaded at all (and should not). As I understood --keep-going option in make is needed for situation where we have target A that depends on targets B and C, and if B failed with keep-going option make still will execute C. If that's how it work then it's redundant here as we run only pg-tde tests here, am I wrong?

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.

5 participants