Skip to content

ROX-30259: Add a basic integration test framework#1

Merged
erthalion merged 8 commits intomainfrom
mauro/ROX-30259-integration-tests
Aug 15, 2025
Merged

ROX-30259: Add a basic integration test framework#1
erthalion merged 8 commits intomainfrom
mauro/ROX-30259-integration-tests

Conversation

@Molter73
Copy link
Copy Markdown
Contributor

@Molter73 Molter73 commented Jul 28, 2025

Description

The tests are based on pytest, since it should be the easiest way to get them to run on as many systems as possible natively. The only test that has been implemented is incredibly simple and naive, just create a new directory, run fact monitoring said directory create a file in there and expect an event from fact in a gRPC server.

In order to work around a verifier issue, path filtering has been moved from the kernel to userspace, this is not ideal and we might need to come back and fix it sometime in the future.

Next step will be to flesh out the tests and integrate them with the collector ansible scripts to run them on GCP.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

Run the tests locally on a Fedora 42 machine and pass:

make -C tests
make[1]: Entering directory '/home/xxxxxx/go/src/github.com/molter73/fact/tests'
python3 -m grpc_tools.protoc \
        -I../third_party/stackrox/proto \
        --python_out=/home/xxxxxx/go/src/github.com/molter73/fact/tests \
        --pyi_out=/home/xxxxxx/go/src/github.com/molter73/fact/tests \
        --grpc_python_out=/home/xxxxxx/go/src/github.com/molter73/fact/tests \
        ../third_party/stackrox/proto/internalapi/sensor/collector.proto ../third_party/stackrox/proto/internalapi/sensor/sfa.proto ../third_party/stackrox/proto/internalapi/sensor/sfa_iservice.proto
pytest
=================================================================================== test session starts ===================================================================================
platform linux -- Python 3.13.5, pytest-8.4.1, pluggy-1.6.0
rootdir: /home/xxxxxx/go/src/github.com/molter73/fact/tests
collected 1 item

test_basic.py .                                                                                                                                                                     [100%]

==================================================================================== 1 passed in 1.22s ====================================================================================

@Molter73 Molter73 force-pushed the mauro/ROX-30259-integration-tests branch 10 times, most recently from ca1b341 to 930ee4b Compare July 30, 2025 12:13
@Molter73 Molter73 marked this pull request as ready for review July 30, 2025 12:40
@ovalenti
Copy link
Copy Markdown
Contributor

So ... you are doing fact checking ? 🥁

@Molter73
Copy link
Copy Markdown
Contributor Author

So ... you are doing fact checking ? 🥁

@Molter73 Molter73 requested a review from Stringy August 7, 2025 09:37
The tests are based on pytest, since it should be the easiest way to get
them to run on as many systems as possible natively. The only test that
has been implemented is incredibly simple and naive, just create a new
directory, run fact monitoring said directory create a file in there and
expect an event from fact in a gRPC server.

In order to work around a verifier issue, path filtering has been moved
from the kernel to userspace, this is not ideal and we might need to
come back and fix it sometime in the future.

Next step will be to flesh out the tests and integrate them with the
collector ansible scripts to run them on GCP.
@Molter73 Molter73 force-pushed the mauro/ROX-30259-integration-tests branch from c17b400 to b11f74c Compare August 8, 2025 13:53
* test: Add basis to run integration tests on GCP

* Run integration tests on GCP

* Generate logs and test results and upload them as artifacts

* Add error to test for checking handling of errors on CI

* Revert "Add error to test for checking handling of errors on CI"

This reverts commit 0d99ef6.

* Simplify constants.mk and minor cleanup

* Rename logs fixture to logs_dir
@erthalion erthalion merged commit 0eabd6c into main Aug 15, 2025
4 checks passed
@erthalion erthalion deleted the mauro/ROX-30259-integration-tests branch August 15, 2025 08:48
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.

4 participants