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

feat(coverage): Add simple coverage #2067

Merged
merged 3 commits into from
Sep 27, 2023
Merged

feat(coverage): Add simple coverage #2067

merged 3 commits into from
Sep 27, 2023

Conversation

AlejandroCabeza
Copy link
Contributor

Description

Implement a coverage script that runs all tests and generates the coverage report.

Changes

  • Implement coverage script
  • Add aggregating files under all tests directories that run all test files in that directory.

@AlejandroCabeza AlejandroCabeza changed the title Coverage feat(coverage): Add simple coverage Sep 21, 2023
@github-actions
Copy link

github-actions bot commented Sep 21, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2067

Built from 57e7fc5

@AlejandroCabeza AlejandroCabeza self-assigned this Sep 25, 2023
@vpavlin
Copy link
Member

vpavlin commented Sep 26, 2023

@AlejandroCabeza Something is wrong with the script - this is the output I get

$ ./scripts/run_cov.sh 
Hint: used config file '/home/vpavlin/.choosenim/toolchains/nim-1.6.14/config/nim.cfg' [Conf]
Hint: used config file '/home/vpavlin/.choosenim/toolchains/nim-1.6.14/config/config.nims' [Conf]
Hint: used config file '/home/vpavlin/devel/github.com/waku-org/nwaku/config.nims' [Conf]
Hint: used config file '/home/vpavlin/devel/github.com/waku-org/nwaku/tests/nim.cfg' [Conf]
.................................................................
/home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all.nim(1, 2) Error: cannot open file: ""
./scripts/run_cov.sh: 36: /home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all: not found
Capturing coverage data from .
Subroutine read_intermediate_text redefined at /usr/bin/geninfo line 2637.
Subroutine read_intermediate_json redefined at /usr/bin/geninfo line 2669.
Subroutine intermediate_text_to_info redefined at /usr/bin/geninfo line 2717.
Subroutine intermediate_json_to_info redefined at /usr/bin/geninfo line 2806.
Subroutine get_output_fd redefined at /usr/bin/geninfo line 2886.
Subroutine print_gcov_warnings redefined at /usr/bin/geninfo line 2914.
Subroutine process_intermediate redefined at /usr/bin/geninfo line 2944.
Found gcov version: 12.3.0
Using intermediate gcov format
Using JSON module JSON::PP
Scanning . for .gcda files ...
geninfo: WARNING: no .gcda files found in . - skipping!
Finished .info-file creation
Reading data file /home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all.info
genhtml: ERROR: no valid records found in tracefile /home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all.info

@AlejandroCabeza
Copy link
Contributor Author

AlejandroCabeza commented Sep 26, 2023

@AlejandroCabeza Something is wrong with the script - this is the output I get

$ ./scripts/run_cov.sh 
Hint: used config file '/home/vpavlin/.choosenim/toolchains/nim-1.6.14/config/nim.cfg' [Conf]
Hint: used config file '/home/vpavlin/.choosenim/toolchains/nim-1.6.14/config/config.nims' [Conf]
Hint: used config file '/home/vpavlin/devel/github.com/waku-org/nwaku/config.nims' [Conf]
Hint: used config file '/home/vpavlin/devel/github.com/waku-org/nwaku/tests/nim.cfg' [Conf]
.................................................................
/home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all.nim(1, 2) Error: cannot open file: ""
./scripts/run_cov.sh: 36: /home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all: not found
Capturing coverage data from .
Subroutine read_intermediate_text redefined at /usr/bin/geninfo line 2637.
Subroutine read_intermediate_json redefined at /usr/bin/geninfo line 2669.
Subroutine intermediate_text_to_info redefined at /usr/bin/geninfo line 2717.
Subroutine intermediate_json_to_info redefined at /usr/bin/geninfo line 2806.
Subroutine get_output_fd redefined at /usr/bin/geninfo line 2886.
Subroutine print_gcov_warnings redefined at /usr/bin/geninfo line 2914.
Subroutine process_intermediate redefined at /usr/bin/geninfo line 2944.
Found gcov version: 12.3.0
Using intermediate gcov format
Using JSON module JSON::PP
Scanning . for .gcda files ...
geninfo: WARNING: no .gcda files found in . - skipping!
Finished .info-file creation
Reading data file /home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all.info
genhtml: ERROR: no valid records found in tracefile /home/vpavlin/devel/github.com/waku-org/nwaku/tests/test_all.info

@vpavlin Interesting, have you tried running the script with env.sh loaded? Either with a sourced terminal source env.sh or with ./env.sh ./scripts/run_cov.sh, I mean.

@vpavlin
Copy link
Member

vpavlin commented Sep 27, 2023

Yeah, that works, the report is being generated.

Copy link
Member

@vpavlin vpavlin left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this

@AlejandroCabeza AlejandroCabeza merged commit d864db3 into master Sep 27, 2023
3 checks passed
@AlejandroCabeza AlejandroCabeza deleted the coverage branch September 27, 2023 13:53
ABresting pushed a commit that referenced this pull request Sep 30, 2023
* Add test aggregator to all directories.
* Implement coverage script.
ABresting added a commit that referenced this pull request Sep 30, 2023
* chore: add retention policy with GB or MB limitation #1885

* chore: add retention policy with GB or MB limitation

* chore: updated code post review- retention policy

* ci: extract discordNotify to separate file

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* ci: push images to new wakuorg/nwaku repo

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* ci: enforce default Docker image tags strictly

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* ci: push GIT_REF if it looks like a version

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* fix: update wakuv2 fleet DNS discovery enrtree

https://github.com/status-im/infra-misc/issues/171

* chore: resolving DNS IP and publishing it when no extIp is provided (#2030)

* feat(coverage): Add simple coverage (#2067)

* Add test aggregator to all directories.
* Implement coverage script.

* fix(ci): fix name of discord notify method

Also use absolute path to load Groovy script.

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* chore(networkmonitor): refactor setConnectedPeersMetrics, make it partially concurrent, add version (#2080)

* chore(networkmonitor): refactor setConnectedPeersMetrics, make it partially concurrent, add version

* add more metrics, refactor how most metrics are calculated

* rework metrics table fillup

* reset connErr to make sure we honour successful reconnection

* chore(cbindings): Adding cpp example that integrates the 'libwaku' (#2079)

* Adding cpp example that integrates the `libwaku`

---------

Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>

* fix(ci): update the dependency list in pre-release WF (#2088)

* chore: adding NetConfig test suite (#2091)

---------

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Co-authored-by: Jakub Sokołowski <jakub@status.im>
Co-authored-by: Anton Iakimov <yakimant@gmail.com>
Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
Co-authored-by: Álex Cabeza Romero <alex93cabeza@gmail.com>
Co-authored-by: Vaclav Pavlin <vaclav@status.im>
Co-authored-by: Ivan Folgueira Bande <128452529+Ivansete-status@users.noreply.github.com>
Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
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.

2 participants