From 991916ab42a3c4924ac8107ff77712a99f73a490 Mon Sep 17 00:00:00 2001 From: francois Date: Mon, 19 Jan 2026 23:49:59 +0100 Subject: [PATCH] First complete prototype. To be polished. --- src/main.tex | 1 + src/preamble.tex | 27 +++- src/sections/conclusion.tex | 15 ++- src/sections/functionalities.tex | 204 +++++++++++++++++++++++++++++++ src/sections/functionlities.tex | 0 src/sections/intro.tex | 2 +- src/sections/items.tex | 19 ++- 7 files changed, 257 insertions(+), 11 deletions(-) create mode 100644 src/sections/functionalities.tex delete mode 100644 src/sections/functionlities.tex diff --git a/src/main.tex b/src/main.tex index b3140fd..4e6a1a0 100644 --- a/src/main.tex +++ b/src/main.tex @@ -15,5 +15,6 @@ \include{sections/items} \include{sections/functionalities} \include{sections/tips} +\include{sections/conclusion} \end{document} \ No newline at end of file diff --git a/src/preamble.tex b/src/preamble.tex index a3cbfe9..3dce8dd 100644 --- a/src/preamble.tex +++ b/src/preamble.tex @@ -43,8 +43,8 @@ % ===================== % Informations % ===================== -\title{Testium training} -\subtitle{Introduction tutorial} +\title{\tum{testium}} +\subtitle{Tool introduction training} \author{François Dausseur} % \institute{Nom de l'entreprise} \date{\today} @@ -73,7 +73,6 @@ frame=none } - \setbeamertemplate{footline}{ \leavevmode% \hbox{% @@ -84,4 +83,26 @@ \insertframenumber{} / \inserttotalframenumber\hspace{1em} \end{beamercolorbox}% } +} + +\definecolor{linkcolor}{RGB}{0,102,153} % bleu pro +\definecolor{urlcolor}{RGB}{80,80,80} % gris foncé +\definecolor{citecolor}{RGB}{0,102,153} + +\hypersetup{ + colorlinks=true, + linkcolor=linkcolor, + urlcolor=linkcolor, + citecolor=linkcolor, + pdfborderstyle={/S/U/W 1} % underline +} + +\captionsetup{ + font=scriptsize +} + +\AtBeginSection[]{ + \begin{frame}{Summary} + \tableofcontents[currentsection] + \end{frame} } \ No newline at end of file diff --git a/src/sections/conclusion.tex b/src/sections/conclusion.tex index dd63dae..b861eca 100644 --- a/src/sections/conclusion.tex +++ b/src/sections/conclusion.tex @@ -1,9 +1,16 @@ \section{Conclusion} -\begin{frame}{Conclusion} +\begin{frame}{Questions ?} + \centering + \vfill + {\Huge\bfseries Thank you} + \vfill +\end{frame} + +\begin{frame}{Contact} \begin{itemize} - \item Template prêt à l'emploi - \item Compatible environnements entreprise - \item Adaptable à votre charte graphique + \item François Dausseur + \item francois.dausseur@free.fr + \item \url{https://git.beafrancois.fr/v_and_v/testium} \end{itemize} \end{frame} \ No newline at end of file diff --git a/src/sections/functionalities.tex b/src/sections/functionalities.tex new file mode 100644 index 0000000..81ec8bc --- /dev/null +++ b/src/sections/functionalities.tex @@ -0,0 +1,204 @@ +\section{\tum{testium} functionalities} + +\begin{frame}{Post-processing test items results} + \begin{itemize} + \item You can process the result directly in the item using : + \begin{itemize} + \item \incode{process\_result}: To process the result of an item Done before \incode{expected\_result} + \item \incode{expected\_result}: Set the expected result of the item + \end{itemize} + \item \incode{\$(result)}: test item result expansion + \item \incode{process\_result} + \begin{itemize} + \item Process the result with a python evaluation + \item Test is \incode{PASS} if value is \incode{True} + \item It can typically + \begin{itemize} + \item Store a variable + \item Make a complex test, replacing a \incode{check} item + \end{itemize} + \end{itemize} + \item \incode{expected\_result} + \begin{itemize} + \item Check if it equals the test item result (processed or not) + \end{itemize} + \end{itemize} +\end{frame} + +\begin{frame}[fragile]{Result processing example} + \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} +- TBD: + \end{minted} +\end{frame} + +\begin{frame}[fragile]{Include} + \begin{itemize} + \item a .tum file can be included from another .tum file + \item There is no limit on the number of included files + \item The included file must not have a \incode{main} defined + \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} +#include with the sub-sequence reference mechanism +sequence: &included_sequence + !include included_file.tum + +main: + name: Test example + steps: + - test_item1: + name: test_1 + - *included_sequence + + #include can also be inserted directly within the steps list + - !include included_file.tum + \end{minted} + \end{itemize} +\end{frame} + +\begin{frame}{Templating} + \begin{itemize} + \item A template engine is a files preprocessor + \item applies to all \tum{testium} files + \begin{itemize} + \item main test file + \item any included file + \end{itemize} + \item Files are processed at the moment the test is opened + \item recursively on all included sub-tests + \end{itemize} +\end{frame} + +\begin{frame}[fragile]{Template engine syntax} +\begin{columns} + \column{0.6\textwidth} + \begin{itemize} + \item Any test file can use the Jinja syntax for templates + \begin{itemize} + \item \href{https://jinja.palletsprojects.com/en/stable/}{Template Documentation} + \end{itemize} + \item expressions + \begin{itemize} + \item \incode{\{\{ my\_expression \}\}} + \end{itemize} + \item control sequences + \begin{itemize} + \item \incode{\{\% if condition \%\} ... \{\% endif \%\}} + \item \incode{\{\% for iterator \%\} ... \{\% endfor \%\}} + \item ... + \end{itemize} + \item All config-file parameters can be used in templates + \end{itemize} + \column{0.4\textwidth} + \begin{listing}[H] + \begin{minted}[fontsize=\fontsize{5}{6}\selectfont]{yaml} +items: + - common + - check + - console + - cycle + - dialogs + \end{minted} + \begin{minted}[fontsize=\fontsize{5}{6}\selectfont]{yaml} +config_file: + - param.yaml +main: +[...] +{% for item in items %} + # item test + - let: + name: test constants + values: + test: {{ item }} + test_path: items/$(test) + - group: + name: {{ item }} test + action: + - !include items/{{ item }}/test.seq + - !include items/report.seq +{% endfor %} +[...] + \end{minted} + \caption{\incode{param.xml} followed by \incode{main.tum}} + \end{listing} +\end{columns} +\end{frame} + +\begin{frame}[fragile]{Template parameters} + \begin{itemize} + \item main file + \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} +main: + name: Test example + steps: + - test_item1: + name: test_1 + - !include + file: included_template_file.tum + inclusion_parameter_1: param1 + inclusion_parameter_2: param2 + \end{minted} + \item \incode{included\_template\_file.tum} + \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} + - test_item: + name: {{ inclusion_parameter_1 }} + - {{ inclusion_parameter_2 }}: + name: test_3 + # The following construction is not allowed and will fail to load: + - test_item: + name: {{ $(inclusion)_parameter_3 }} + \end{minted} + \end{itemize} +\end{frame} + +\begin{frame}{JINJA syntax vs \tum{testium} syntax} + \begin{itemize} + \item Jinja and \tum{testium} syntax super-imposed + \begin{itemize} + \item Jinja is evaluated first, when the test is loaded + \item then \tum{testium} displays the result of template pre-processing + \end{itemize} + \item loops + \begin{itemize} + \item Jinja : loops result in a flat sequence of steps + \item \tum{testium} : The loop is a test item and its iterations can depend on runtime parameters + \end{itemize} + \item conditional execution + \begin{itemize} + \item Jinja : The item appears or not, depending on static configuration parameter, or jinja syntax + \item \tum{testium} : The condition can depend on runtime parameters + \end{itemize} + \end{itemize} +\end{frame} + +\begin{frame}[fragile]{\incode{report} section and test items} +\begin{columns} + \column{0.6\textwidth} + \begin{itemize} + \item Supports sqlite, Junit, JSON, txt formats + \item Designed to ease the addition of new formats if any specific request + \item Added to the root of the main .tum file + \begin{itemize} + \item \incode{path}: The report path + \item \incode{file\_name}: The name of the report file + \item \incode{export}: The type of export + \item \incode{log\_stored}: Stores the log extracts in the report + \end{itemize} + \item the \incode{report} test item can also generate some intermediate reports + \begin{itemize} + \item the \incode{key} test item parameter allows to filter reported steps + \end{itemize} + \end{itemize} + \column{0.4\textwidth} + \begin{listing}[H] + \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} +report: + enabled: True + log_stored: True + export: + junit: + path: $(validation_report_path) + file_name: $(validation_report_file).junit + \end{minted} + \caption{\incode{report} example} + \end{listing} +\end{columns} +\end{frame} \ No newline at end of file diff --git a/src/sections/functionlities.tex b/src/sections/functionlities.tex deleted file mode 100644 index e69de29..0000000 diff --git a/src/sections/intro.tex b/src/sections/intro.tex index 8720ab4..4b72ebe 100644 --- a/src/sections/intro.tex +++ b/src/sections/intro.tex @@ -96,7 +96,7 @@ main: \item \tum{testium} can be invoked with the following options: \begin{itemize} \item \incode{-h}: command line help - \item \incode{-b}: batc5h mode (execution of the test script without GUI) + \item \incode{-b}: batch mode (execution of the test script without GUI) \item \incode{-c}: Use a specific config file \item \incode{-i}: Set a specific include path \item \incode{-g}: Run in debug mode (for vscode debug only) diff --git a/src/sections/items.tex b/src/sections/items.tex index 9718a5d..3128a5f 100644 --- a/src/sections/items.tex +++ b/src/sections/items.tex @@ -82,9 +82,13 @@ \begin{itemize} \item \incode{cn\_} : Containing the last data which has been read in the console \end{itemize} - \item func test itm specific variables + \item \incode{py\_func} test item specific variables \begin{itemize} - \item \incode{fn\_} : The returned value of the last func test item execution + \item \incode{pfn\_} : The returned value of the last \incode{py\_func} test item execution + \end{itemize} + \item \incode{lua\_func} test item specific variables + \begin{itemize} + \item \incode{lfn\_} : The returned value of the last \incode{lua\_func} test item execution \end{itemize} \item loop test item specific variables \begin{itemize} @@ -381,5 +385,14 @@ tm = require("testium") \end{minted} \caption{\incode{json\_rpc} query and answer separated} \end{listing} - \end{columns} +\end{columns} +\end{frame} + +\begin{frame}{Other test items} + \begin{itemize} + \item \incode{plot}: Displays and stores time series data + \item \incode{run}: Execute a new instance of \tum{testium} + \item \incode{unittest\_file}: Runs a Python file based on the unittest framework + \end{itemize} + \end{frame} \ No newline at end of file