[LNT] r312602 - Improve submit test

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 17:47:49 PDT 2017


Author: matze
Date: Tue Sep  5 17:47:49 2017
New Revision: 312602

URL: http://llvm.org/viewvc/llvm-project?rev=312602&view=rev
Log:
Improve submit test

- Do not submit the same run twice during the script
- Extend server_wrapper with a mode that fails the test if errors
  are found in the server log.

Added:
    lnt/trunk/tests/SharedInputs/sample-report1.json
    lnt/trunk/tests/SharedInputs/sample-report2.json
    lnt/trunk/tests/lnttool/Inputs/compile_submission1.json
Modified:
    lnt/trunk/tests/SharedInputs/server_wrapper.sh
    lnt/trunk/tests/lnttool/submit.shtest

Added: lnt/trunk/tests/SharedInputs/sample-report1.json
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/sample-report1.json?rev=312602&view=auto
==============================================================================
--- lnt/trunk/tests/SharedInputs/sample-report1.json (added)
+++ lnt/trunk/tests/SharedInputs/sample-report1.json Tue Sep  5 17:47:49 2017
@@ -0,0 +1,55 @@
+{
+    "Machine": {
+        "Info": {
+            "os": "SAMPLE OS",
+            "hardware": "x86_64"
+        },
+        "Name": "LNT SAMPLE MACHINE"
+    },
+    "Run": {
+        "Start Time": "2009-11-17 02:12:25",
+        "End Time": "2009-11-17 03:44:48",
+        "Info": {
+            "run_order": "2",
+            "tag": "nts",
+            "__report_version__": "1"
+        }
+    },
+    "Tests": [
+        {
+            "Data": [
+                0.6995
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.compile"
+        },
+        {
+            "Data": [
+                "49333a87d501b0aea2191830b66b5eec"
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.hash"
+        },
+        {
+            "Data": [
+                2.2521
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.exec"
+        },
+        {
+            "Data": [
+                0.1234
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects-link.compile"
+        },
+        {
+            "Data": [
+                12432.0
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.code_size"
+        }
+    ]
+}

Added: lnt/trunk/tests/SharedInputs/sample-report2.json
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/sample-report2.json?rev=312602&view=auto
==============================================================================
--- lnt/trunk/tests/SharedInputs/sample-report2.json (added)
+++ lnt/trunk/tests/SharedInputs/sample-report2.json Tue Sep  5 17:47:49 2017
@@ -0,0 +1,55 @@
+{
+    "Machine": {
+        "Info": {
+            "os": "SAMPLE OS",
+            "hardware": "x86_64"
+        },
+        "Name": "LNT SAMPLE MACHINE"
+    },
+    "Run": {
+        "Start Time": "2009-11-17 02:12:25",
+        "End Time": "2009-11-17 03:44:48",
+        "Info": {
+            "run_order": "3",
+            "tag": "nts",
+            "__report_version__": "1"
+        }
+    },
+    "Tests": [
+        {
+            "Data": [
+                0.6995
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.compile"
+        },
+        {
+            "Data": [
+                "49333a87d501b0aea2191830b66b5eec"
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.hash"
+        },
+        {
+            "Data": [
+                2.2521
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.exec"
+        },
+        {
+            "Data": [
+                0.1234
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects-link.compile"
+        },
+        {
+            "Data": [
+                12432.0
+            ],
+            "Info": {},
+            "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.code_size"
+        }
+    ]
+}

Modified: lnt/trunk/tests/SharedInputs/server_wrapper.sh
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/server_wrapper.sh?rev=312602&r1=312601&r2=312602&view=diff
==============================================================================
--- lnt/trunk/tests/SharedInputs/server_wrapper.sh (original)
+++ lnt/trunk/tests/SharedInputs/server_wrapper.sh Tue Sep  5 17:47:49 2017
@@ -26,6 +26,12 @@ main() {
     [ $# -lt 2 ] &&
         error "not enough arguments"
 
+    local fail_on_error=0
+    if [ "$1" = "--fail-on-error" ]; then
+        fail_on_error=1
+        shift
+    fi
+
     local server_instance=$1
     local port_number=$2
     shift 2
@@ -51,6 +57,14 @@ main() {
         error "wha happen??  ${kill_rc}"
 
     wait ${pid}
+
+    if [ "$fail_on_error" = "1" ]; then
+        if egrep "ERROR|FATAL|raise" "${server_instance}/server_wrapper_runserver.log"; then
+            echo 1>&2 "Logfile indicates problems: ${server_instance}/server_wrapper_runserver.log"
+            exit 1
+        fi
+    fi
+
     exit ${rc}
 }
 

Added: lnt/trunk/tests/lnttool/Inputs/compile_submission1.json
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/Inputs/compile_submission1.json?rev=312602&view=auto
==============================================================================
--- lnt/trunk/tests/lnttool/Inputs/compile_submission1.json (added)
+++ lnt/trunk/tests/lnttool/Inputs/compile_submission1.json Tue Sep  5 17:47:49 2017
@@ -0,0 +1,75 @@
+{
+	"Machine": {
+		"Info": {
+			"hw.activecpu": "4",
+			"machdep.cpu.vendor": "GenuineIntel",
+			"os_version": "42"
+		},
+		"Name": "some-compile-suite-machine"
+	},
+	"Run": {
+		"End Time": "2017-07-06 15:37:08",
+		"Start Time": "2017-07-06 15:05:23",
+		"Info": {
+			"__report_version__": "1",
+			"run_order": "663347",
+			"tag": "compile"
+		}
+	},
+	"Tests": [
+        {
+            "Data": [
+                14.601326,
+                14.411566,
+                14.490528
+            ],
+            "Info": {},
+            "Name": "compile.build/Adium-1.5.7(config='Debug',j=1).user"
+        },
+        {
+            "Data": [
+                6.35114,
+                6.021678,
+                6.008406
+            ],
+            "Info": {},
+            "Name": "compile.build/Adium-1.5.7(config='Debug',j=1).sys"
+        },
+        {
+            "Data": [
+                20.398301,
+                20.121045,
+                19.722336
+            ],
+            "Info": {},
+            "Name": "compile.build/Adium-1.5.7(config='Debug',j=1).wall"
+        },
+        {
+            "Data": [
+                38.057092,
+                38.091625,
+                38.051625
+            ],
+            "Info": {},
+            "Name": "compile.build/Adium-1.5.7(config='Release',j=1).user"
+        },
+                {
+            "Data": [
+                12.423008,
+                12.409628,
+                12.398736
+            ],
+            "Info": {},
+            "Name": "compile.build/Adium-1.5.7(config='Release',j=1).sys"
+        },
+        {
+            "Data": [
+                50.016597,
+                49.881782,
+                49.90554
+            ],
+            "Info": {},
+            "Name": "compile.build/Adium-1.5.7(config='Release',j=1).wall"
+        }
+	]
+}

Modified: lnt/trunk/tests/lnttool/submit.shtest
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/submit.shtest?rev=312602&r1=312601&r2=312602&view=diff
==============================================================================
--- lnt/trunk/tests/lnttool/submit.shtest (original)
+++ lnt/trunk/tests/lnttool/submit.shtest Tue Sep  5 17:47:49 2017
@@ -2,7 +2,7 @@
 # RUN: rm -rf %t.tmp && mkdir -p %t.tmp
 # RUN: python %{shared_inputs}/create_temp_instance.py \
 # RUN:   %s %{shared_inputs}/SmallInstance %t.instance
-# RUN: %{shared_inputs}/server_wrapper.sh %t.instance 9091 \
+# RUN: %{shared_inputs}/server_wrapper.sh --fail-on-error %t.instance 9091 \
 # RUN:    /bin/sh %s %t.tmp %S/Inputs %{shared_inputs} %{src_root}
 
 OUTPUT_DIR="$1"
@@ -29,11 +29,11 @@ lnt submit "http://localhost:9091/db_def
 
 
 # Make sure the old --commit=1 style argument is still accepted.
-lnt submit "http://localhost:9091/db_default/submitRun" --commit=1 "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit0.txt"
+lnt submit "http://localhost:9091/db_default/submitRun" --commit=1 "${SHARED_INPUTS}/sample-report1.json" > "${OUTPUT_DIR}/submit0.txt"
 # RUN: FileCheck %s --check-prefix=CHECK-SUBMIT0 < %t.tmp/submit0.txt
 # CHECK-SUBMIT0: http://localhost:9091/db_default/v4/nts/4
 
-lnt submit "http://localhost:9091/db_default/submitRun" --commit 1 "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit1.txt"
+lnt submit "http://localhost:9091/db_default/submitRun" --commit 1 "${SHARED_INPUTS}/sample-report2.json" > "${OUTPUT_DIR}/submit1.txt"
 # RUN: FileCheck %s --check-prefix=CHECK-SUBMIT1 < %t.tmp/submit1.txt
 # CHECK-SUBMIT1: http://localhost:9091/db_default/v4/nts/5
 
@@ -74,7 +74,7 @@ lnt submit "http://localhost:9091/db_def
 # For the old submitters/formats we have some detection logic to determine the
 # test-suite based on the Info.Run.tag field instead of the URL. The result
 # should be the same as using the "correct" URL.
-lnt submit "http://localhost:9091/db_default/submitRun" "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile1.txt"
+lnt submit "http://localhost:9091/db_default/submitRun" "${INPUTS}/compile_submission1.json" -v > "${OUTPUT_DIR}/submit_compile1.txt"
 # RUN: FileCheck %s --check-prefix=CHECK-COMPILE1 < %t.tmp/submit_compile1.txt
 #
 # CHECK-COMPILE1: Import succeeded.




More information about the llvm-commits mailing list