CSIT-836: PDF format: Improvements in pdf layout 80/8780/16
authorTibor Frank <tifrank@cisco.com>
Thu, 12 Oct 2017 10:47:56 +0000 (12:47 +0200)
committerTibor Frank <tifrank@cisco.com>
Wed, 18 Oct 2017 14:39:27 +0000 (14:39 +0000)
CSIT-837: Scope of pdf version

Change-Id: Idfc9c04274c6635fbef14f87147665d31cfd7352
Signed-off-by: Tibor Frank <tifrank@cisco.com>
docs/report/detailed_test_results/index.rst
docs/report/test_configuration/index.rst
docs/report/test_operational_data/index.rst
docs/report/vpp_performance_tests/csit_release_notes.rst
resources/tools/presentation/conf.py
resources/tools/presentation/generator_files.py
resources/tools/presentation/generator_report.py

index 9a986bc..4c89f1f 100644 (file)
@@ -1,11 +1,14 @@
-Detailed Test Results
-=====================
+.. only:: html
 
-.. toctree::
 
-    vpp_performance_results/index
-    dpdk_performance_results/index
-    vpp_functional_results/index
-    honeycomb_functional_results/index
-    nshsfc_functional_results/index
-    vpp_unittest_results/index
+    Detailed Test Results
+    =====================
+
+    .. toctree::
+
+        vpp_performance_results/index
+        dpdk_performance_results/index
+        vpp_functional_results/index
+        honeycomb_functional_results/index
+        nshsfc_functional_results/index
+        vpp_unittest_results/index
index 908f494..3963896 100644 (file)
@@ -1,7 +1,10 @@
-Test Configuration
-==================
+.. only:: html
 
-.. toctree::
 
-    vpp_performance_configuration/index
-    vpp_functional_configuration/index
+    Test Configuration
+    ==================
+
+    .. toctree::
+
+        vpp_performance_configuration/index
+        vpp_functional_configuration/index
index 44e7fb0..d5eca48 100644 (file)
@@ -1,6 +1,8 @@
-Test Operational Data\r
-=====================\r
+.. only::  html\r
 \r
-.. toctree::\r
+    Test Operational Data\r
+    =====================\r
 \r
-    vpp_performance_operational_data/index\r
+    .. toctree::\r
+\r
+        vpp_performance_operational_data/index\r
index 812d5f2..8499bca 100644 (file)
@@ -99,18 +99,64 @@ NDR Throughput
 \r
 Non-Drop Rate Throughput discovery tests:\r
 \r
-.. csv-table::\r
-    :align: center\r
-    :file: performance_improvements/performance_improvements_ndr_top.csv\r
+.. only:: html\r
+\r
+   .. csv-table::\r
+      :align: center\r
+      :file: performance_improvements/performance_improvements_ndr_top.csv\r
+\r
+.. only:: latex\r
+\r
+   .. raw:: latex\r
+\r
+      \makeatletter\r
+      \csvset{\r
+        perfimprovements column width/.style={after head=\csv@pretable\begin{longtable}{ m{1.5cm} m{5cm} m{#1} m{#1} m{#1} m{#1} m{#1} m{#1}}\csv@tablehead},\r
+      }\r
+      \makeatother\r
+\r
+      {\tiny\r
+      \csvautobooklongtable[separator=comma,\r
+        respect all,\r
+        no check column count,\r
+        perfimprovements column width=1cm,\r
+        late after line={\\\hline},\r
+        late after last line={\end{longtable}}\r
+        ]{../_tmp/src/vpp_performance_tests/performance_improvements/performance_improvements_ndr_top.csv}\r
+      }\r
+\r
 \r
 PDR Throughput\r
 ~~~~~~~~~~~~~~\r
 \r
 Partial Drop Rate thoughput discovery tests with packet Loss Tolerance of 0.5%:\r
 \r
-.. csv-table::\r
-    :align: center\r
-    :file: performance_improvements/performance_improvements_pdr_top.csv\r
+.. only:: html\r
+\r
+   .. csv-table::\r
+      :align: center\r
+      :file: performance_improvements/performance_improvements_pdr_top.csv\r
+\r
+.. only:: latex\r
+\r
+   .. raw:: latex\r
+\r
+      \makeatletter\r
+      \csvset{\r
+        perfimprovements column width/.style={after head=\csv@pretable\begin{longtable}{ m{1.5cm} m{5cm} m{#1} m{#1} m{#1} m{#1} m{#1} m{#1}}\csv@tablehead},\r
+      }\r
+      \makeatother\r
+\r
+      {\tiny\r
+      \csvautobooklongtable[separator=comma,\r
+        respect all,\r
+        no check column count,\r
+        perfimprovements column width=1cm,\r
+        late after line={\\\hline},\r
+        late after last line={\end{longtable}}\r
+        ]{../_tmp/src/vpp_performance_tests/performance_improvements/performance_improvements_pdr_top.csv}\r
+      }\r
+\r
 \r
 Measured improvements are in line with VPP code optimizations listed in\r
 `VPP-17.07 release notes\r
@@ -129,18 +175,63 @@ NDR Throughput
 \r
 Non-Drop Rate Throughput discovery tests:\r
 \r
-.. csv-table::\r
-    :align: center\r
-    :file: performance_improvements/performance_improvements_ndr_low.csv\r
+.. only:: html\r
+\r
+   .. csv-table::\r
+      :align: center\r
+      :file: performance_improvements/performance_improvements_ndr_low.csv\r
+\r
+.. only:: latex\r
+\r
+   .. raw:: latex\r
+\r
+      \makeatletter\r
+      \csvset{\r
+        perfimprovements column width/.style={after head=\csv@pretable\begin{longtable}{ m{1.5cm} m{5cm} m{#1} m{#1} m{#1} m{#1} m{#1} m{#1}}\csv@tablehead},\r
+      }\r
+      \makeatother\r
+\r
+      {\tiny\r
+      \csvautobooklongtable[separator=comma,\r
+        respect all,\r
+        no check column count,\r
+        perfimprovements column width=1cm,\r
+        late after line={\\\hline},\r
+        late after last line={\end{longtable}}\r
+        ]{../_tmp/src/vpp_performance_tests/performance_improvements/performance_improvements_ndr_low.csv}\r
+      }\r
+\r
 \r
 PDR Throughput\r
 ~~~~~~~~~~~~~~\r
 \r
 Partial Drop Rate thoughput discovery tests with packet Loss Tolerance of 0.5%:\r
 \r
-.. csv-table::\r
-    :align: center\r
-    :file: performance_improvements/performance_improvements_pdr_low.csv\r
+.. only:: html\r
+\r
+   .. csv-table::\r
+      :align: center\r
+      :file: performance_improvements/performance_improvements_pdr_low.csv\r
+\r
+.. only:: latex\r
+\r
+   .. raw:: latex\r
+\r
+      \makeatletter\r
+      \csvset{\r
+        perfimprovements column width/.style={after head=\csv@pretable\begin{longtable}{ m{1.5cm} m{5cm} m{#1} m{#1} m{#1} m{#1} m{#1} m{#1}}\csv@tablehead},\r
+      }\r
+      \makeatother\r
+\r
+      {\tiny\r
+      \csvautobooklongtable[separator=comma,\r
+        respect all,\r
+        no check column count,\r
+        perfimprovements column width=1cm,\r
+        late after line={\\\hline},\r
+        late after last line={\end{longtable}}\r
+        ]{../_tmp/src/vpp_performance_tests/performance_improvements/performance_improvements_pdr_low.csv}\r
+      }\r
 \r
 \r
 Known Issues\r
index 2c942c4..6cc0240 100644 (file)
@@ -157,6 +157,8 @@ latex_elements = {
          \usepackage[defaultsans]{lato}
          \usepackage{inconsolata}
          \usepackage{csvsimple}
+         \usepackage{longtable}
+         \usepackage{booktabs}
      ''',
 
      # Latex figure (float) alignment
index 0989fc7..dd70c70 100644 (file)
@@ -68,15 +68,20 @@ def file_test_results(file_spec, input_data):
     file_name = "{0}{1}".format(file_spec["output-file"],
                                 file_spec["output-file-ext"])
     rst_header = file_spec["file-header"]
-    rst_include_table = ("\n.. csv-table::\n"
-                         "    :header-rows: 1\n"
-                         "    :widths: auto\n"
-                         "    :align: center\n"
-                         "    :file: {file}\n\n")
+
+    rst_include_table = ("\n.. only:: html\n\n"
+                         "    .. csv-table::\n"
+                         "        :header-rows: 1\n"
+                         "        :widths: auto\n"
+                         "        :align: center\n"
+                         "        :file: {file_html}\n"
+                         "\n.. only:: latex\n\n"
+                         "\n  .. raw:: latex\n\n"
+                         "      \csvautolongtable{{{file_latex}}}\n\n")
 
     logging.info("  Generating the file {0} ...".format(file_name))
 
-    table_lst = get_files(file_spec["dir-tables"], ".csv", full_path=False)
+    table_lst = get_files(file_spec["dir-tables"], ".csv", full_path=True)
     if len(table_lst) == 0:
         logging.error("  No tables to include in '{0}'. Skipping.".
                       format(file_spec["dir-tables"]))
@@ -103,7 +108,9 @@ def file_test_results(file_spec, input_data):
             if tests_in_suite(suite_name, input_data.tests(job, build)):
                 for tbl_file in table_lst:
                     if suite_name in tbl_file:
-                        file_handler.write(rst_include_table.
-                                           format(file=tbl_file))
+                        file_handler.write(
+                            rst_include_table.format(
+                                file_latex=tbl_file,
+                                file_html=tbl_file.split("/")[-1]))
 
     logging.info("  Done.")
index 8a3f833..55aa24b 100644 (file)
@@ -50,6 +50,7 @@ THEME_OVERRIDES = """/* override table width restrictions */
 # Command to build the html format of the report
 HTML_BUILDER = 'sphinx-build -v -c . -a ' \
                '-b html -E ' \
+               '-t html ' \
                '-D release={release} ' \
                '-D version="{release} report - {date}" ' \
                '{working_dir} ' \
@@ -58,6 +59,7 @@ HTML_BUILDER = 'sphinx-build -v -c . -a ' \
 # Command to build the pdf format of the report
 PDF_BUILDER = 'sphinx-build -v -c . -a ' \
               '-b latex -E ' \
+              '-t latex ' \
               '-D release={release} ' \
               '-D version="{release} report - {date}" ' \
               '{working_dir} ' \

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.