Skip to content

chore(libsinsp): add target to build library for sinsp integration tests#2740

Merged
poiana merged 1 commit intofalcosecurity:masterfrom
irozzo-1A:add-sinsp-test-target
Dec 9, 2025
Merged

chore(libsinsp): add target to build library for sinsp integration tests#2740
poiana merged 1 commit intofalcosecurity:masterfrom
irozzo-1A:add-sinsp-test-target

Conversation

@irozzo-1A
Copy link
Copy Markdown
Contributor

@irozzo-1A irozzo-1A commented Dec 6, 2025

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind test

/kind feature

/kind sync

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

Add a target to be able to build sinsp integration tests on other projects e.g. plugins

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Using find_package makes it easier to handle the gtest dependency, but it requires cmake 3.24 to be able to use OVERRIDE_FIND_PACKAGE option with FetchContent.

Does this PR introduce a user-facing change?:

NONE

@poiana poiana added release-note-none kind/test PRs increasing the test coverage without fixing any failing test dco-signoff: yes labels Dec 6, 2025
@poiana poiana requested review from hbrueckner and terror96 December 6, 2025 22:13
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 6, 2025

Perf diff from master - unit tests

     4.26%    +12.90%  [.] std::__shared_ptr<sinsp_threadinfo, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<sinsp_threadinfo, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
     3.41%    +11.93%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const
     3.98%     +9.32%  [.] sinsp_threadinfo::get_main_thread()
     3.34%     +8.15%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_lock_nothrow()
     3.19%     +7.18%  [.] sinsp_threadinfo::update_main_fdtable()
     2.99%     +6.37%  [.] sinsp_threadinfo::get_fd_table()
     1.99%     +5.93%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
     5.71%     +5.73%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
    10.89%     -5.38%  [.] sinsp::next(sinsp_evt**)
     1.75%     +3.59%  [.] thread_group_info::get_first_thread() const

Heap diff from master - unit tests

peak heap memory consumption: 27.68K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            -0.0443         -0.0445           248           237           247           236
BM_sinsp_split_median                                          -0.0407         -0.0408           248           237           247           237
BM_sinsp_split_stddev                                          +1.3164         +1.2946             1             3             1             3
BM_sinsp_split_cv                                              +1.4239         +1.4014             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0506         +0.0505            70            74            70            74
BM_sinsp_concatenate_paths_relative_path_median                +0.0575         +0.0575            70            74            69            73
BM_sinsp_concatenate_paths_relative_path_stddev                -0.9023         -0.9039             1             0             1             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.9070         -0.9085             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0803         -0.0804            44            40            44            40
BM_sinsp_concatenate_paths_empty_path_median                   -0.0706         -0.0705            44            40            44            40
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.8803         -0.8859             1             0             1             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.8699         -0.8759             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0298         +0.0298            71            73            71            73
BM_sinsp_concatenate_paths_absolute_path_median                +0.0318         +0.0320            71            74            71            74
BM_sinsp_concatenate_paths_absolute_path_stddev                +1.9686         +2.0502             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    +1.8827         +1.9619             0             0             0             0

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.52%. Comparing base (e65bb86) to head (921c091).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2740      +/-   ##
==========================================
- Coverage   77.02%   74.52%   -2.51%     
==========================================
  Files         296      291       -5     
  Lines       30818    30012     -806     
  Branches     4670     4714      +44     
==========================================
- Hits        23738    22366    -1372     
- Misses       7080     7646     +566     
Flag Coverage Δ
libsinsp 74.52% <ø> (-2.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch from 352f11c to 89c6be5 Compare December 6, 2025 23:00
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch from f59c6a2 to ad1f611 Compare December 6, 2025 23:28
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch 2 times, most recently from a36b3f3 to 0383ce6 Compare December 7, 2025 09:10
@poiana poiana added size/M and removed size/L labels Dec 7, 2025
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch from 0383ce6 to d6169d8 Compare December 7, 2025 09:55
@poiana poiana added size/L and removed size/M labels Dec 7, 2025
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch from d6169d8 to 4d22932 Compare December 7, 2025 10:20
@irozzo-1A irozzo-1A marked this pull request as draft December 7, 2025 10:31
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch 2 times, most recently from e50bea5 to 39ea8a7 Compare December 7, 2025 21:22
@irozzo-1A irozzo-1A marked this pull request as ready for review December 9, 2025 09:33
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch from 39ea8a7 to 98e2d4c Compare December 9, 2025 09:40
@irozzo-1A irozzo-1A force-pushed the add-sinsp-test-target branch from 98e2d4c to 921c091 Compare December 9, 2025 09:59
Copy link
Copy Markdown
Contributor

@ekoops ekoops left a comment

Choose a reason for hiding this comment

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

/milestone 0.23.0
/approve

@poiana poiana added this to the 0.23.0 milestone Dec 9, 2025
@poiana poiana added the lgtm label Dec 9, 2025
@poiana
Copy link
Copy Markdown
Contributor

poiana commented Dec 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops, irozzo-1A

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Dec 9, 2025
@poiana
Copy link
Copy Markdown
Contributor

poiana commented Dec 9, 2025

LGTM label has been added.

DetailsGit tree hash: a88ad93faa790269a84c0d9a266ec2630d75013a

Copy link
Copy Markdown
Contributor

@terror96 terror96 left a comment

Choose a reason for hiding this comment

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

Don't really know too much about cmake files, but since it passes the tests it /lgtm

@terror96 terror96 self-requested a review December 9, 2025 11:54
Copy link
Copy Markdown
Contributor

@terror96 terror96 left a comment

Choose a reason for hiding this comment

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

Don't really know too much about cmake files, but since it passes the tests it /lgtm

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap Dec 9, 2025
@poiana poiana merged commit 0d61d53 into falcosecurity:master Dec 9, 2025
46 of 47 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants