Selaa lähdekoodia

verify Raw file was not being created correctly

Each test's `raw` file was only being created if the test was
successfully benchmarked, but we need the file to exist if the
test was only MARKED as having should benchmark.

Confusing...

Okay, so if your test has a `json` test specified, but it did not
pass validation, we skip benchmarking it (as there is no good reason
to benchmark a test that is broken/cheating/improper/etc). The
problem is that in skipping the test, we never created the `raw`
file in the `results/[name]/[timestamp]/json/[test name]/` dir,
which means that when we parse the results, instead of appending
`[test name]` to the list of failed, we ignored it.

This commit touches the `raw` file in the benchmarking step
regardless of whether the validation was successful. We still skip
benchmarking if the test was not valid, but now the `raw` file for
testX's `json` will exist and be empty, giving us enough information
to suggest it failed during parsing.
Mike Smith 11 vuotta sitten
vanhempi
commit
7ba9fc1b86
1 muutettua tiedostoa jossa 24 lisäystä ja 0 poistoa
  1. 24 0
      toolset/benchmark/framework_test.py

+ 24 - 0
toolset/benchmark/framework_test.py

@@ -453,6 +453,10 @@ class FrameworkTest:
           out.flush()
           results = None
           output_file = self.benchmarker.output_file(self.name, self.JSON)
+          if not os.path.exists(output_file):
+            with open(output_file, 'w'):
+              # Simply opening the file in write mode should create the empty file.
+              pass
           if self.json_url_passed:
             remote_script = self.__generate_concurrency_script(self.json_url, self.port, self.accept_json)
             self.__run_benchmark(remote_script, output_file, err)
@@ -471,6 +475,10 @@ class FrameworkTest:
           out.flush()
           results = None
           output_file = self.benchmarker.output_file(self.name, self.DB)
+          if not os.path.exists(output_file):
+            with open(output_file, 'w'):
+              # Simply opening the file in write mode should create the empty file.
+              pass
           if self.db_url_passed:
             remote_script = self.__generate_concurrency_script(self.db_url, self.port, self.accept_json)
             self.__run_benchmark(remote_script, output_file, err)
@@ -488,6 +496,10 @@ class FrameworkTest:
           out.flush()
           results = None
           output_file = self.benchmarker.output_file(self.name, self.QUERY)
+          if not os.path.exists(output_file):
+            with open(output_file, 'w'):
+              # Simply opening the file in write mode should create the empty file.
+              pass
           if self.query_url_passed:
             remote_script = self.__generate_query_script(self.query_url, self.port, self.accept_json)
             self.__run_benchmark(remote_script, output_file, err)
@@ -506,6 +518,10 @@ class FrameworkTest:
           out.flush()
           results = None
           output_file = self.benchmarker.output_file(self.name, self.FORTUNE)
+          if not os.path.exists(output_file):
+            with open(output_file, 'w'):
+              # Simply opening the file in write mode should create the empty file.
+              pass
           if self.fortune_url_passed:
             remote_script = self.__generate_concurrency_script(self.fortune_url, self.port, self.accept_html)
             self.__run_benchmark(remote_script, output_file, err)
@@ -524,6 +540,10 @@ class FrameworkTest:
           out.flush()
           results = None
           output_file = self.benchmarker.output_file(self.name, self.UPDATE)
+          if not os.path.exists(output_file):
+            with open(output_file, 'w'):
+              # Simply opening the file in write mode should create the empty file.
+              pass
           if self.update_url_passed:
             remote_script = self.__generate_query_script(self.update_url, self.port, self.accept_json)
             self.__run_benchmark(remote_script, output_file, err)
@@ -542,6 +562,10 @@ class FrameworkTest:
           out.flush()
           results = None
           output_file = self.benchmarker.output_file(self.name, self.PLAINTEXT)
+          if not os.path.exists(output_file):
+            with open(output_file, 'w'):
+              # Simply opening the file in write mode should create the empty file.
+              pass
           if self.plaintext_url_passed:
             remote_script = self.__generate_concurrency_script(self.plaintext_url, self.port, self.accept_plaintext, wrk_command="wrk-pipeline", intervals=[256,1024,4096,16384], pipeline="--pipeline 16")
             self.__run_benchmark(remote_script, output_file, err)