|
| 1 | +=== STA Work Package C: CI/CD Automation |
| 2 | + |
| 3 | +Contact: Siva Mahadevan <smahadevan@freebsdfoundation.org> |
| 4 | + |
| 5 | +In this quarter, as part of the infrastructure modernization work commissioned by the Sovereign Tech Agency (STA), I have been working on the in-tree CI Makefile targets. I also worked on bringing our CI test reports to a clean state on our tier-1 architectures (amd64 and aarch64). This report is a supplement to the overall STA status report and will describe the work done in more detail. |
| 6 | + |
| 7 | +==== /tests/ci improvements |
| 8 | + |
| 9 | +The /tests/ci subdirectory of the src tree was introduced in link:https://cgit.freebsd.org/src/commit/?id=cb9d4bb1fbb9ac0eb9f211656e91f9d5254c166c[commit: Add preliminary in-tree CI infrastructure for developers] by bofh@ and aims to provide an easy way for developers to replicate the CI testing run by link:https://ci.freebsd.org[our Jenkins cluster]. In this quarter, the following improvements were made by the team: |
| 10 | + |
| 11 | +New functionality: |
| 12 | + |
| 13 | +* link:https://cgit.freebsd.org/src/commit/?id=f6e5bcd4716c2974c7ceb1fbbfc0ef8db8e13d8b[tests/ci: run ci-full kyua tests in parallel] |
| 14 | +* link:https://cgit.freebsd.org/src/commit/?id=92a7f2d577630d670643f855a1d123a2260102af[tests/ci: Add KYUA_TEST_FILTERS to allow user to select specific tests] |
| 15 | +* link:https://cgit.freebsd.org/src/commit/?id=932cf5fa44b7ff3b7ea21ccb32bbbefff11c160c[tests/ci: Add CIENV variable] |
| 16 | + |
| 17 | +Bug fixes: |
| 18 | + |
| 19 | +* link:https://cgit.freebsd.org/src/commit/?id=ed4c64bc792fd2509d8fd6805f8e174c2db62338[tests/ci: Use suitable variable for qemu-user-static existence check] |
| 20 | +* link:https://cgit.freebsd.org/src/commit/?id=2f50ea54c6e3b15f655e800eb680ddcb80e30b4f[tests/ci: fix race condition in bhyveload boot] |
| 21 | +* link:https://cgit.freebsd.org/src/commit/?id=57f725a6a6c19b12015854589764babe58252155[tests/ci: fix missing /usr/local/{sbin,bin} in freebsdci rc PATH] |
| 22 | +* link:https://cgit.freebsd.org/src/commit/?id=9f3e4b28f9dec27b73eeebd161d119d1e9864081[tests/ci: Fix missing qemu devices] |
| 23 | +* link:https://cgit.freebsd.org/src/commit/?id=10fb5e7117e522540167fa02692e1e7b8e38eec0[tests/ci: Fix race condition with ci-extractmeta] |
| 24 | +* link:https://cgit.freebsd.org/src/commit/?id=66fe805070d121d4b93f63b7b02a70d76069edfc[tests/ci: Fix wrong chflags target path in 'beforeclean' target] |
| 25 | +* link:https://cgit.freebsd.org/src/commit/?id=9ec37e8ff49c6b555e8d4f522adc9378157df170[tests/ci: Use QEMU blockdev declaration for all platforms] |
| 26 | +* link:https://cgit.freebsd.org/src/commit/?id=e990e460d50c628dfa681c5693bd8ece87b001ad[tests/ci: Fix unescaped kld_list var in rc.conf] |
| 27 | + |
| 28 | +With these changes, a developer can run CI with these example commands as root: |
| 29 | + |
| 30 | +[source,shell] |
| 31 | +---- |
| 32 | +# Fully parallel CI: |
| 33 | +make ci |
| 34 | +
|
| 35 | +# Single-threaded CI |
| 36 | +make PARALLEL_JOBS=1 ci |
| 37 | +
|
| 38 | +# Single-threaded CI, running a subset of the tests as described in kyua-test(1) |
| 39 | +make PARALLEL_JOBS=1 KYUA_TEST_FILTERS='/path/to/testcase /path/to/another:testname1' ci |
| 40 | +
|
| 41 | +# Run smoke (boot) tests |
| 42 | +make CITYPE=smoke ci |
| 43 | +---- |
| 44 | + |
| 45 | +==== Test case management |
| 46 | + |
| 47 | +Since the last quarter, link:https://ci.freebsd.org/tinderbox[Tinderbox] has been reporting that our supported platforms are failing in CI since a link:https://ci.freebsd.org/job/FreeBSD-main-amd64-test/26756/[run from the last quarter]. As the backlog grows larger, it becomes harder for users and developers to notice a new failure and pin a failure to a particular commit. |
| 48 | + |
| 49 | +To complement the /tests/ci CI/CD automation improvements, along with link:https://github.com/markjdb/bricoler[Bricoler] to help with more granular investigations, I worked on cleaning up the failing test backlog on tier-1 architectures. The following patches and bug reports were submitted as a result of this (still ongoing) work: |
| 50 | + |
| 51 | +New bug reports filed to track failing or flaky tests: |
| 52 | + |
| 53 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288991[PR 288991: sys/netinet/output:output_raw_flowid_mpath_success] |
| 54 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289096[PR 289096: lib/libexecinfo/sigtramp_test:test_backtrace_sigtramp] |
| 55 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289165[PR 289165: usr.bin/limits/limits_test:cputime_soft_flag] |
| 56 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289240[PR 289240: sys/netlink/netlink_socket:overflow] |
| 57 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289239[PR 289239: sys/netpfil/pf/sctp:pfsync] |
| 58 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289236[PR 289236: sys/kern/exterr_test:gettext_extended] |
| 59 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289382[PR 289382: sys/netinet6/lpm6:lpm6_test1_success] |
| 60 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289628[PR 289628: sys/netpfil/pf/nat:endpoint_independent_pass] |
| 61 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289630[PR 289630: libexec/rc/rc_subr_test:wait_for_pids_progress] |
| 62 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289237[PR 289237: sys/fs/fusefs/last_local_modify:main] |
| 63 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289084[PR 289084: lib/libc/string/memcmp_test:{diff,neq}] |
| 64 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289477[PR 289477: sys/netpfil/pf/route_to:prefer_ipv6_nexthop_mixed_af_random_table_ipv4] |
| 65 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289299[PR 289299: sys/netpfil/pf/rules_counter:keepcounters] |
| 66 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289684[PR 289684: sys/netlink/test_snl:snl_parse_errmsg_capped] |
| 67 | +* link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289146[PR 289146: sbin/ipfw/test_add_rule.py:TestAddRule::test_add_action] |
| 68 | + |
| 69 | +Unskip tests that are wrongly skipped in CI: |
| 70 | + |
| 71 | +* link:https://cgit.freebsd.org/src/commit/?id=6ff78a63d8cd0dd64ae79cbda5cb03572c1e17f5[tests/sys/netpfil: unskip tests that no longer need to be skipped] |
| 72 | +* link:https://cgit.freebsd.org/src/commit/?id=178b9c2364740ead21f584dc30c3aa45bd0bb8bf[tests/ci: Add missing kmods and pkgs to unskip tests] |
| 73 | + |
| 74 | +Test case metadata fixes: |
| 75 | + |
| 76 | +* link:https://cgit.freebsd.org/src/commit/?id=83b08f40264177ecf03fce808474815816f9846f[fix parallel execution of swapon tests] |
| 77 | +* link:https://cgit.freebsd.org/src/commit/?id=1e570722dced7a3afc0a35b10af047b835e51567[cap_dns/tests/dns_test: mark tests as needing network access] |
| 78 | +* link:https://cgit.freebsd.org/src/commit/?id=68fe0d9cc03bd80f63a5317a633d2426ae286316[pfctl tests: use require.kmods instead of manual check for pf] |
| 79 | +* link:https://cgit.freebsd.org/src/commit/?id=df88c711a26c04192761e96dc08a6f3f9e42afed[cap_net/net_test: require 'allow_network_access'] |
| 80 | +* link:https://cgit.freebsd.org/src/commit/?id=5dadfac51c3876b0ba6fde831cb4417594167fed[tests/mac_portacl: enable is_exclusive for now] |
| 81 | +* link:https://cgit.freebsd.org/src/commit/?id=cacfd42b0c57b3455ca4a23e21de071fa0cc9ed0[tests/sys/mqueue: use require.kmods property instead of ad-hoc checks] |
| 82 | +* link:https://cgit.freebsd.org/src/commit/?id=215a0654186926b2e4497d83f3eb45b5eefcb23f[tests/sys/netlink: use require.kmods property instead of ad-hoc checks] |
| 83 | +* link:https://cgit.freebsd.org/src/commit/?id=308c9c995794f1ae89bba1d43aab9c51f7e90a09[tests/sys/opencrypto: use require.kmods property instead of ad-hoc checks] |
| 84 | +* link:https://cgit.freebsd.org/src/commit/?id=26d3dfa8733892adf107b045a8c98d480b4bb21d[tests/sys/aio: use require.kmods property instead of ad-hoc checks] |
| 85 | +* link:https://cgit.freebsd.org/src/commit/?id=c444bfca0063d0820f3fc72cb429809f5f52a970[tests/pf/ioctl: use require.kmods property instead of ad-hoc checks] |
| 86 | +* link:https://cgit.freebsd.org/src/commit/?id=559b0f6b82867b60a2d5cb1b2744114603cb17a7[tests/sys/netmap: use require.kmods property instead of ad-hoc checks] |
| 87 | +* link:https://cgit.freebsd.org/src/commit/?id=74898ce961e1f4818eba500dfa3a06bc30c1d9b3[tests/sndstat: use require.kmods property instead of ad-hoc checks] |
| 88 | +* link:https://cgit.freebsd.org/src/commit/?id=7a1a6d1e2a836d189447ba725b0e256014613ab8[tests/socket_accf: use require.kmods property instead of ad-hoc checks] |
| 89 | +* link:https://cgit.freebsd.org/src/commit/?id=4079513328d5656e31cb853a799176ff2500f79b[tests/sys/net: use require.kmods property instead of ad-hoc checks] |
| 90 | +* link:https://cgit.freebsd.org/src/commit/?id=427be10491e37160a82eef31622676c655a29f1e[tests/sys/netinet: use require.kmods property instead of ad-hoc checks] |
| 91 | +* link:https://cgit.freebsd.org/src/commit/?id=f53228c4e398468c71d3ed8a372cc29ccae6a0c1[tests/vmm_cred_jail: use require.kmods property instead of ad-hoc checks] |
| 92 | + |
| 93 | +mark tests as "expected fail" (xfail), currently WIP: |
| 94 | + |
| 95 | +* link:https://cgit.freebsd.org/src/commit/?id=df997faca8411bdf8008c25de5db3ed719019d21[atf_pytest: fix xfail detection from pytest report] |
| 96 | + |
| 97 | +==== Tooling (WIP) |
| 98 | + |
| 99 | +To catch errors more quickly, instead of relying on link:https://ci.freebsd.org[Jenkins] to update the test report, I ran local CI multiple times daily. To help with this, I worked on some tooling to speed up the testing/debugging cycles. I am maintaining the following (currently uncommitted) tools: |
| 100 | + |
| 101 | +* link:https://codeberg.org/svmhdvn/mypoudriere/src/branch/main/myfreebsd[parallel CI runner built on top of /tests/ci] |
| 102 | +* link:https://codeberg.org/svmhdvn/depistage[(VERY WIP) automated CI bug report/triage system] |
| 103 | + |
| 104 | +Sponsor: The FreeBSD Foundation |
0 commit comments