Skip to content

Add integration tests results to codecov #2044

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

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/integration-tests-vm-type.yml
Original file line number Diff line number Diff line change
@@ -104,7 +104,14 @@ jobs:
if: |
failure() && !inputs.run-benchmarks
with:
paths: integration-tests/container-logs/**/integration-test-report-*.xml
paths: integration-tests/container-logs/**/integration-test-report-*.junit.xml

- uses: codecov/test-results-action@v1
if: ${{ !cancelled() }}
with:
directory: integration-tests/container-logs
token: ${{ secrets.CODECOV_TOKEN }}
flags: collector-integration-tests

- name: Create Benchmark VMs
if: inputs.run-benchmarks
13 changes: 13 additions & 0 deletions .github/workflows/k8s-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -32,6 +32,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: integration-tests/go.mod

- uses: actions/setup-python@v5
with:
python-version: "3.10"
@@ -92,6 +96,15 @@ jobs:
path: |
${{ github.workspace }}/integration-tests/container-logs/**/*

- uses: codecov/test-results-action@v1
if: ${{ !cancelled() }}
with:
files: integration-test-k8s.junit.xml
directory: integration-tests
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
flags: collector-integration-tests

notify:
runs-on: ubuntu-24.04
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
17 changes: 16 additions & 1 deletion ansible/k8s-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@
value: "{{ lookup('env', 'COLLECTOR_QA_TAG', default=lookup('file', collector_root + '/integration-tests/container/QA_TAG')) }}"
- name: COLLECTOR_IMAGE
value: "{{ collector_image }}"
args: ["-test.run", "^TestK8s.*"]
args: ["-test.run", "^TestK8s.*", "-test.v"]
ports:
- containerPort: 9999
volumeMounts:
@@ -190,6 +190,21 @@
tags:
- test-only

- name: Write logs
ansible.builtin.copy:
content: "{{ log.log }}"
dest: "{{ collector_root }}/integration-tests/integration-test-k8s.log"
mode: '644'

- name: Report
community.general.make:
chdir: "{{ collector_root }}/integration-tests"
target: report
environment:
LOG_FILE: "{{ collector_root }}/integration-tests/integration-test-k8s.log"
JUNIT_FILE: "integration-test-k8s.junit.xml"
delegate_to: localhost

- name: Cleanup namespace
kubernetes.core.k8s:
state: absent
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@
target: report
environment:
LOG_FILE: "{{ logs_root }}/integration-test-{{ vm_config }}.log"
JUNIT_FILE: "integration-test-report-{{ vm_config }}.xml"
JUNIT_FILE: "integration-test-report-{{ vm_config }}.junit.xml"
delegate_to: localhost

# If this host is just for a certain collection method, skip running
2 changes: 2 additions & 0 deletions integration-tests/suites/k8s/namespace.go
Original file line number Diff line number Diff line change
@@ -82,6 +82,8 @@ func (k *K8sNamespaceTestSuite) TestK8sNamespace() {
namespace, ok := namespaceInterface.(string)
k.Require().True(ok)
k.Require().Equal(namespace, tt.expectecNamespace)

k.Require().FailNow("Test failure")
}
}

2 changes: 2 additions & 0 deletions integration-tests/suites/process_network.go
Original file line number Diff line number Diff line change
@@ -115,6 +115,8 @@ func (s *ProcessNetworkTestSuite) TestProcessViz() {
}

s.Sensor().ExpectProcesses(s.T(), s.serverContainer, 10*time.Second, expectedProcesses...)

s.Require().FailNow("Test failure")
}

func (s *ProcessNetworkTestSuite) TestProcessLineageInfo() {