action #181604
openImprove error detection in GitLab CI scrippts
0%
Description
Motivation¶
The following lines are copied from this CI job log:
/tmp/tmp.dZdgq4ib0A
1450:161 error line too long (500 > 160 characters) (line-length)
1501:161 error line too long (464 > 160 characters) (line-length)
1536:161 error line too long (552 > 160 characters) (line-length)
1603:161 error line too long (408 > 160 characters) (line-length)
1655:161 error line too long (445 > 160 characters) (line-length)
1707:161 error line too long (408 > 160 characters) (line-length)
1809:161 error line too long (408 > 160 characters) (line-length)
1862:161 error line too long (451 > 160 characters) (line-length)
3339:161 error line too long (408 > 160 characters) (line-length)
3418:161 error line too long (408 > 160 characters) (line-length)
3638:161 error line too long (275 > 160 characters) (line-length)
3690:161 error line too long (283 > 160 characters) (line-length)
4212:161 error line too long (465 > 160 characters) (line-length)
4384:161 error line too long (455 > 160 characters) (line-length)
4474:161 error line too long (455 > 160 characters) (line-length)
5430:161 error line too long (464 > 160 characters) (line-length)
5712:161 error line too long (540 > 160 characters) (line-length)
5811:161 error line too long (540 > 160 characters) (line-length)
Checking schedule and test data file existence from https://github.com/os-autoinst/os-autoinst-distri-opensuse
[Check File Existence] : referenced file schedule/yast/sle/flows/''.yaml not found
Despite the erros reported the job is "green" and passed.
Possible root cause¶
If you look at the ci_runner_test.sh
you see these lines:
#!/bin/sh
# Parameters:
# $1 = Group name, that is the subdir under JobGroups
# $2 = Group ID, the openQA group ID of the target group
echo "job started by $GITLAB_USER_LOGIN for pull request $CI_MERGE_REQUEST_ID"
yaml_file="$(./scripts/generate_yaml.py -d JobGroups/$1 -o $(mktemp))";cat $yaml_file
yamllint $yaml_file
echo "Checking schedule and test data file existence from https://github.com/os-autoinst/os-autoinst-distri-opensuse"
scripts/verify_files_existence.py -p $TEST_REPO $(grep -oP '(YAML_SCHEDULE|YAML_TEST_DATA|YAML_SCHEDULE_DEFAULT|YAML_SCHEDULE_FLOWS):\s\K.*' $yaml_file | sort -u)
openqa-cli api -X POST $OPENQA_CLIENT_PARAMS job_templates_scheduling/$2 schema=JobTemplates-01.yaml preview=1 --param-file template="$yaml_file"
So the errors about "loine too long" come from yamllint
.
The error about the missing schedule comes from verfiy_file_existence
. Here we also have the problem, that some test suites in migration have a line
+YAML_SCHEDULE: ``
which leads to the problem because inside the verify_file_existence
script this line will be considered as part of a "YAML_SCHEDULE_FLOW" which is wrong here, so if the lines in migrations are there for a reason we need to treat this special case in in the script correctly.
The overall problemm is that each of those checks has a return code that might indicate a problem, but at the end the CI result is just depending on the return code of the last command which is the openqa-cli
command in this case.
Acceptance criteria¶
-
AC1: The whole CI script returns "fail" at least for failures in
verify_file_existence
-
AC2: Lines with
+YAML_SCHEDULE: ''
do not cause errors.
Additional info¶
The issue about line lengths might be tricky because those problems are caused by our very long AGAMA_PROFILE_OPTIONS
lines that then needed to be broken up if possible.
No data to display