summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Cook <jscook2345@gmail.com>2020-10-30 12:32:01 -0500
committerJustin Cook <jscook2345@gmail.com>2020-10-30 12:32:01 -0500
commit86ef61df7761d71fcf9f15883688b8d4a35c989e (patch)
treef1329ef6e63faa42a0cb6d7afad8279eece5c20e
parentc2665ffbbccb5bf59112722f3363e3ff1de2b4d5 (diff)
Do not show the hash for an empty kconfig
-rw-r--r--squad_client/commands/submit.py10
-rw-r--r--tests/data/submit/tuxbuild/buildset.json62
-rw-r--r--tests/test_submit.py16
3 files changed, 85 insertions, 3 deletions
diff --git a/squad_client/commands/submit.py b/squad_client/commands/submit.py
index bbf93b8..b2cc9dd 100644
--- a/squad_client/commands/submit.py
+++ b/squad_client/commands/submit.py
@@ -121,10 +121,14 @@ class SubmitCommand(SquadClientCommand):
def _get_tuxbuild_test_name(self, build):
suite = "build"
- kconfig_hash = hashlib.sha1(json.dumps(build["kconfig"][1:]).encode()).hexdigest()[0:8]
- return "%s/%s-%s-%s-%s" % (
- suite, build["target_arch"], build["toolchain"], build["kconfig"][0], kconfig_hash,
+ if len(build["kconfig"][1:]):
+ kconfig = "%s-%s" % (build["kconfig"][0], hashlib.sha1(json.dumps(build["kconfig"][1:]).encode()).hexdigest()[0:8])
+ else:
+ kconfig = build["kconfig"][0]
+
+ return "%s/%s-%s-%s" % (
+ suite, build["target_arch"], build["toolchain"], kconfig,
)
def run(self, args):
diff --git a/tests/data/submit/tuxbuild/buildset.json b/tests/data/submit/tuxbuild/buildset.json
new file mode 100644
index 0000000..b8fbbf5
--- /dev/null
+++ b/tests/data/submit/tuxbuild/buildset.json
@@ -0,0 +1,62 @@
+[
+ {
+ "build_key": "x5Mi9j6xZItTGqVtOKmnVw",
+ "build_status": "pass",
+ "client_token": "95d6f75e-f374-457c-8833-b0c913057554",
+ "download_url": "https://builds.tuxbuild.com/x5Mi9j6xZItTGqVtOKmnVw/",
+ "errors_count": 0,
+ "git_describe": "next-20201030",
+ "git_repo": "https://gitlab.com/Linaro/lkft/mirrors/next/linux-next",
+ "git_sha": "4e78c578cb987725eef1cec7d11b6437109e9a49",
+ "git_short_log": "4e78c578cb98 (\"Add linux-next specific files for 20201030\")",
+ "kconfig": [
+ "allnoconfig"
+ ],
+ "kernel_version": "5.10.0-rc1",
+ "status_message": "build completed",
+ "target_arch": "x86",
+ "toolchain": "gcc-8",
+ "tuxbuild_status": "complete",
+ "warnings_count": 0
+ },
+ {
+ "build_key": "cjLreGasHSZj3OctZlNdpw",
+ "build_status": "pass",
+ "client_token": "d1a50659-5a64-416d-8896-1c4d4159c31e",
+ "download_url": "https://builds.tuxbuild.com/cjLreGasHSZj3OctZlNdpw/",
+ "errors_count": 0,
+ "git_describe": "next-20201030",
+ "git_repo": "https://gitlab.com/Linaro/lkft/mirrors/next/linux-next",
+ "git_sha": "4e78c578cb987725eef1cec7d11b6437109e9a49",
+ "git_short_log": "4e78c578cb98 (\"Add linux-next specific files for 20201030\")",
+ "kconfig": [
+ "tinyconfig"
+ ],
+ "kernel_version": "5.10.0-rc1",
+ "status_message": "build completed",
+ "target_arch": "x86",
+ "toolchain": "gcc-8",
+ "tuxbuild_status": "complete",
+ "warnings_count": 0
+ },
+ {
+ "build_key": "9NeOU1kd65bhMrL4eyI2yA",
+ "build_status": "pass",
+ "client_token": "6f740266-63ae-48e0-859c-63d9c4a947aa",
+ "download_url": "https://builds.tuxbuild.com/9NeOU1kd65bhMrL4eyI2yA/",
+ "errors_count": 0,
+ "git_describe": "next-20201030",
+ "git_repo": "https://gitlab.com/Linaro/lkft/mirrors/next/linux-next",
+ "git_sha": "4e78c578cb987725eef1cec7d11b6437109e9a49",
+ "git_short_log": "4e78c578cb98 (\"Add linux-next specific files for 20201030\")",
+ "kconfig": [
+ "x86_64_defconfig"
+ ],
+ "kernel_version": "5.10.0-rc1",
+ "status_message": "build completed",
+ "target_arch": "x86",
+ "toolchain": "gcc-8",
+ "tuxbuild_status": "complete",
+ "warnings_count": 0
+ }
+]
diff --git a/tests/test_submit.py b/tests/test_submit.py
index 151be44..9740fca 100644
--- a/tests/test_submit.py
+++ b/tests/test_submit.py
@@ -159,6 +159,22 @@ class SubmitCommandTest(unittest.TestCase):
self.assertEqual("build/arm64-gcc-9-defconfig-5b09568e", test.name)
self.assertEqual("fail", test.status)
+ def test_submit_results_tuxbuild_buildset_json(self):
+ proc = self.manage_submit(results='tests/data/submit/tuxbuild/buildset.json', results_layout='tuxbuild_json')
+ self.assertIn("Submitting 3 tests", proc.err)
+
+ test = first(self.squad.tests(name="x86-gcc-8-allnoconfig"))
+ self.assertEqual("build/x86-gcc-8-allnoconfig", test.name)
+ self.assertEqual("pass", test.status)
+
+ test = first(self.squad.tests(name="x86-gcc-8-tinyconfig"))
+ self.assertEqual("build/x86-gcc-8-tinyconfig", test.name)
+ self.assertEqual("pass", test.status)
+
+ test = first(self.squad.tests(name="x86-gcc-8-x86_64_defconfig"))
+ self.assertEqual("build/x86-gcc-8-x86_64_defconfig", test.name)
+ self.assertEqual("pass", test.status)
+
def test_submit_results_tuxbuild_json_malformed(self):
proc = self.manage_submit(results='tests/data/submit/tuxbuild/malformed.json', results_layout='tuxbuild_json')
self.assertFalse(proc.ok, msg=proc.err)