File tree 3 files changed +57
-0
lines changed
3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 3
3
timeout:
4
4
minutes: {{ job_timeout|default(15) }}
5
5
definitions:
6
+ {% if "coverage" in node .data .config_full %}
7
+ {% include "util/gcov-reset.jinja2" %}
8
+ {% endif %}
6
9
- repository: https://github.com/kernelci/test-definitions
7
10
from: git
8
11
revision: kernelci.org
12
15
TST_CMDFILES: "{{ tst_cmdfiles|default('') }}"
13
16
SKIP_INSTALL: "{{ skip_install }}"
14
17
SKIPFILE: {{ skipfile }}
18
+ {% if "coverage" in node .data .config_full %}
19
+ {% include "util/gcov-upload.jinja2" %}
20
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ - from: inline
2
+ repository:
3
+ metadata:
4
+ format: Lava-Test Test Definition 1.0
5
+ name: reset-gcov
6
+ description: Reset GCOV data
7
+ run:
8
+ steps:
9
+ - GCOV_RESET="/sys/kernel/debug/gcov/reset"
10
+ - if [ -f ${GCOV_RESET} ]; then echo 1 > ${GCOV_RESET}; fi
11
+ name: reset-gcov
12
+ path: inline/reset-gcov.yaml
Original file line number Diff line number Diff line change
1
+ - from: inline
2
+ name: upload
3
+ path: inline/upload.yaml
4
+ repository:
5
+ metadata:
6
+ description: GCOV artifacts upload
7
+ format: Lava-Test Test Definition 1.0
8
+ name: upload
9
+ environment:
10
+ - lava-test-shell
11
+ os:
12
+ - debian
13
+ run:
14
+ steps:
15
+ - GCDA=/sys/kernel/debug/gcov
16
+ # Bail out if $GCDA doesn't exist (as GCOV is likely not enabled)
17
+ - test -d ${GCDA} || exit 0
18
+ - TEMPDIR=$(mktemp -d)
19
+ - UPLOAD_PATH="{{ node.name }}-{{ node.id }}"
20
+ - UPLOAD_NAME="gcov.tar.xz"
21
+ # Retrieve GCOV artifacts
22
+ # Taken from https://www.kernel.org/doc/html/v6.12/dev-tools/gcov.html#appendix-b-gather-on-test-sh
23
+ - find $GCDA -type d -exec mkdir -p $TEMPDIR/\{\} \;
24
+ - find $GCDA -name '*.gcda' -exec sh -c 'cat < $0 > '$TEMPDIR'/$0' {} \;
25
+ - find $GCDA -name '*.gcno' -exec sh -c 'cp -d $0 '$TEMPDIR'/$0' {} \;
26
+ - tar cJf ${UPLOAD_NAME} -C $TEMPDIR sys
27
+ - rm -rf $TEMPDIR
28
+ # Use set +x so we can don't echo secret tokens in the logs
29
+ - set +x
30
+ - . /lava-${LAVA_JOB_ID}/secrets
31
+ - >-
32
+ lava-test-case "artifact-upload:coverage_data:{{ storage_config.base_url }}/${UPLOAD_PATH}/${UPLOAD_NAME}"
33
+ --shell curl -X POST {{ storage_config.base_url }}/upload
34
+ -H "Authorization: Bearer ${UPLOAD_TOKEN}"
35
+ -F "file0=@${UPLOAD_NAME}"
36
+ -F "path=${UPLOAD_PATH}"
37
+
38
+ secrets:
39
+ UPLOAD_TOKEN: {{ storage_config.name }}-token
You can’t perform that action at this time.
0 commit comments