Merge ~fnordahl/ubuntu/+source/ovn:ubuntu/focal into ~ubuntu-server-dev/ubuntu/+source/ovn:ubuntu/focal

Proposed by Frode Nordahl
Status: Needs review
Proposed branch: ~fnordahl/ubuntu/+source/ovn:ubuntu/focal
Merge into: ~ubuntu-server-dev/ubuntu/+source/ovn:ubuntu/focal
Diff against target: 127 lines (+86/-2)
4 files modified
debian/changelog (+4/-2)
debian/flaky-tests.txt (+4/-0)
debian/rules (+6/-0)
debian/testlist.py (+72/-0)
Reviewer Review Type Date Requested Status
James Page Pending
Review via email: mp+427147@code.launchpad.net
To post a comment you must log in.

Unmerged commits

6d9e777... by Frode Nordahl

release package ovn 20.03.2-0ubuntu0.20.04.4

Signed-off-by: Frode Nordahl <email address hidden>

da487a1... by Frode Nordahl

debian: Determine testlist at build time

The test numbers in the generated autotools testsuite change
whenever upstream adds more tests or extends the test matrix.

Make the flaky test skiplist more robust by programatically
determine the test numbers from the descriptions at build time.

Signed-off-by: Frode Nordahl <email address hidden>
(cherry picked from commit b6cb0d4e1d88f123a20cbc65d841741e4584f5f1)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 44ed514..e555d4b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,4 +1,4 @@
6-ovn (20.03.2-0ubuntu0.20.04.4) UNRELEASED; urgency=medium
7+ovn (20.03.2-0ubuntu0.20.04.4) focal; urgency=medium
8
9 * Adapt to changes made in previous OVS point release (LP: #1980213):
10 - d/control: Update required openvswitch build requirement.
11@@ -8,8 +8,10 @@ ovn (20.03.2-0ubuntu0.20.04.4) UNRELEASED; urgency=medium
12 calling `ovn-ctl stop_controller`
13 - d/p/lp-1940043-0001-Provide-the-option-to-pin-ovn-controller-and-ovn-nor.patch
14 - d/p/lp-1940043-0002-controller-Allow-pinctrl-thread-to-handle-packet-ins.patch
15+ * d/rules, d/testlist.py, d/flaky-tests.txt:
16+ - Dynamically build list of tests to run from list of test descriptions.
17
18- -- Frode Nordahl <frode.nordahl@canonical.com> Thu, 30 Jun 2022 09:50:14 +0000
19+ -- Frode Nordahl <frode.nordahl@canonical.com> Wed, 20 Jul 2022 11:42:49 +0200
20
21 ovn (20.03.2-0ubuntu0.20.04.3) focal; urgency=medium
22
23diff --git a/debian/flaky-tests.txt b/debian/flaky-tests.txt
24new file mode 100644
25index 0000000..2c1b0f4
26--- /dev/null
27+++ b/debian/flaky-tests.txt
28@@ -0,0 +1,4 @@
29+policy-based routing IPv6: 1 HVs, 3 LSs, 1 lport/LS, 1 LR
30+ACLs on Port Groups
31+multi-vtep SB Chassis encap updates
32+ACL with Port Group conjunction flow efficiency
33diff --git a/debian/rules b/debian/rules
34index 9a528c1..cd3fb6d 100755
35--- a/debian/rules
36+++ b/debian/rules
37@@ -30,6 +30,12 @@ override_dh_auto_configure:
38 --with-ovs-source=$(CURDIR)/ovs \
39 --enable-ssl
40
41+# https://bugs.launchpad.net/ubuntu/+source/ovn/+bug/1956749
42+TEST_LIST = $(shell \
43+ $(CURDIR)/debian/testlist.py \
44+ $(CURDIR)/debian/flaky-tests.txt \
45+ $(CURDIR)/tests/testsuite)
46+
47 override_dh_auto_test:
48 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
49 if $(MAKE) check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST)' || \
50diff --git a/debian/testlist.py b/debian/testlist.py
51new file mode 100755
52index 0000000..24d2ae9
53--- /dev/null
54+++ b/debian/testlist.py
55@@ -0,0 +1,72 @@
56+#!/usr/bin/env python3
57+import enum
58+import itertools
59+import os
60+import sys
61+
62+
63+if len(sys.argv) < 3:
64+ print(
65+ "usage: {} skipdescriptionlist testsuite\n"
66+ "\n"
67+ "This program reads two files, a skiplist containing the \n"
68+ "description of tests to skip separated by newline, and a \n"
69+ "generated testsuite script.\n"
70+ "\n"
71+ "From this it produces string with range of tests to execute \n"
72+ "which can be provided to the testsuite script.\n".format(sys.argv[0]),
73+ file=sys.stderr,
74+ )
75+ sys.exit(os.EX_USAGE)
76+
77+
78+SKIP_TEST_STRINGS = []
79+with open(sys.argv[1]) as fin:
80+ SKIP_TEST_STRINGS = [line.rstrip() for line in fin.readlines()]
81+
82+
83+@enum.unique
84+class State(enum.Enum):
85+ INIT = enum.auto()
86+ AT_HELP_ALL = enum.auto()
87+
88+
89+SKIP_TESTS = set()
90+TESTS = set()
91+with open(sys.argv[2]) as fin:
92+ state = State.INIT
93+ last_test = 0
94+ for line in fin.readlines():
95+ if state == State.INIT:
96+ if not line.startswith('at_help_all="'):
97+ continue
98+ else:
99+ state = State.AT_HELP_ALL
100+ data = line.split('"')[1].rstrip().split(";")
101+ elif state == State.AT_HELP_ALL:
102+ if line.startswith('"'):
103+ break
104+ data = line.rstrip().split(";")
105+ test_nr = int(data[0])
106+ if last_test < test_nr:
107+ last_test = test_nr
108+ for skip_string in SKIP_TEST_STRINGS:
109+ if skip_string in data[2]:
110+ SKIP_TESTS.add(test_nr)
111+ else:
112+ TESTS.add(test_nr)
113+
114+
115+def ranges(testlist):
116+ for a, b in itertools.groupby(
117+ enumerate(list(testlist)), lambda pair: pair[1] - pair[0]
118+ ):
119+ b = list(b)
120+ yield b[0][1], b[-1][1]
121+
122+
123+testranges = [
124+ "{}-{}".format(testrange[0], testrange[1])
125+ for testrange in ranges(TESTS - SKIP_TESTS)
126+]
127+print(" ".join(testranges))

Subscribers

People subscribed via source and target branches