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

test: enable coverage of crit unit/e2e tests #121

Merged
merged 5 commits into from
Apr 16, 2023

Commits on Apr 16, 2023

  1. crit: move unit test to crit/ pkg

    To generate code coverage for the unit tests of crit they need to be
    part of the crit package. This patch moves the unit test from
    'test/crit/' to 'crit/' as a preparation for a subsequent patch where
    we would enable test coverage.
    
    Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
    rst0git committed Apr 16, 2023
    Configuration menu
    Copy the full SHA
    91569bf View commit details
    Browse the repository at this point in the history
  2. test: enable coverage of crit unit tests

    This patch enables test coverage for the unit tests of crit.
    
    Suggested-by: Adrian Reber <areber@redhat.com>
    Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
    rst0git committed Apr 16, 2023
    Configuration menu
    Copy the full SHA
    54f0428 View commit details
    Browse the repository at this point in the history
  3. test: enable coverage of crit e2e tests

    This patch enables coverage for the end-to-end tests of crit.
    
    Suggested-by: Adrian Reber <areber@redhat.com>
    Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
    rst0git committed Apr 16, 2023
    Configuration menu
    Copy the full SHA
    7400d2e View commit details
    Browse the repository at this point in the history
  4. test: add makefile for test/loop

    To reduce code duplication, we add a Makefile for building the
    `loop` executable.
    
    Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
    rst0git committed Apr 16, 2023
    Configuration menu
    Copy the full SHA
    36808fe View commit details
    Browse the repository at this point in the history
  5. crit: run unit tests with coverage results

    There are two ways we can enable test coverage for the unit tests:
    1) `-coverprofile` and 2) `-cover`. The first method stores the results
    in a file that we can upload with `codecov`. The second method only
    outputs the test coverage results to standard output.
    
    This patch set the default value of GOFLAGS to `-cover` to
    always show the coverage of unit tests.
    
    Suggested-by: Adrian Reber <areber@redhat.com>
    Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
    rst0git committed Apr 16, 2023
    Configuration menu
    Copy the full SHA
    dbf1473 View commit details
    Browse the repository at this point in the history