\documentclass{ctacomputing}
\usepackage[backgroundcolor=yellow,textwidth=20mm]{todonotes}
\usepackage{lastpage}
\usepackage{fontawesome5}
\usepackage{minted}

\input{build/glossary.tex} % needed to use the glossary, do not remove
\setglossarystyle{tree} % this style will show symbols. use treehypergroup to add clickable heading

\addbibresource{references.bib}

\input{build/customization.tex}
\input{build/preamble.tex}

\newcommand{\ManualTestCase}[3]{}

%allow linebreaks after underscores
\renewcommand\_{\textunderscore{}\allowbreak{}}


% set proper pdf metadata
\hypersetup{
  pdfinfo={
    Title={\ApplicationName{} Release \ApplicationVersion{} Release Report},
    Author={\ApplicationAuthor{}},
    Keywords={CTAO,\ComputingSystem{},Computing,\ApplicationName{}},
  }
}


\colorlet{success}{green!80!black}
\colorlet{failure}{red!80!black}

\title{\ApplicationName{}\\Release \ApplicationVersion{}\\Report}

\begin{document}
\maketitle{}
\ChangeLog{}
\Authors{}
\tableofcontents{}

\chapter{Introduction}

\section{Purpose}

This document describes the \ApplicationFullName{} release \ApplicationVersion{}.
It includes results of the testing activities performed based on \citeapplicable{\ReferenceSDLC}.

\section{Scope}

\References

%\chapter{Use Case and Requirement traceability}
%
%This chapter provides a mapping of the interconnections between Level-B and/or Level-C requirements for \ApplicationName{} version \ApplicationVersion{}, selected for DPPS Rel \ApplicationDPPSReleaseTarget{}, and their realization in specific Use Cases.
%
%\IfFileExists{build/requirements_traceability.tex}{
%   \input{build/requirements_traceability.tex}
%}{
%  \todo[inline]{Please provide DPPS\_Requirements\_Traceability\_Matrix.csv file to generate this chapter, see example in test-report/test_files/DPPS\_Requirements\_Traceability\_Matrix.csv}
%}

\chapter{Dependencies}\label{sec:dependencies}

This section lists \ComputingSystem{} components which are integrated into the \ApplicationName{}.
The same projects may have different names depending on the context, listed in the table below.

\small
\IfFileExists{build/dependencies.tex}{
    \input{build/dependencies.tex}
}{
    \todo[inline]{dependencies.tex is missing: this file should contain the list of dependencies, and is generated by the included script.}
}


\chapter{Static code analysis report}

This chapter should include information about the static code analysis performed on the project's codebase.


\section{SonarQube}

SonarQube implements code quality and security checks as required by \citeapplicable{\ReferenceQAPlan}.
\IfFileExists{build/sonarqube.tex}{
   \input{build/sonarqube.tex}
}{
  \todo[inline]{sonarqube.tex is missing: this file is generated by the included script from the CI test results.}
}

\chapter{Verification}

In this chapter, we summarize the steps performed to verify use cases for this release.
Results of all automated tests are gathered as artifacts from the main project's CI/CD pipeline and automatically placed into each appropriate section.

The chapter is organized into sections that cover the results of different types of testing. Each section details the specific tests performed, the results obtained, and any relevant analysis or observations.

\IfFileExists{build/integration_tests.tex}{
    \input{build/integration_tests.tex}
}{
    \todo[inline]{integration\_tests.tex is missing: this file should contain the results of integration tests, and is generated by the included script from the CI test results.}
}



\section{Manual Testing}

%  This section lists the manual tests, if any, per UC.
\IfFileExists{build/manual_testing.tex}{
   \input{build/manual_testing.tex}
}{
   No manual testing was performed.
}


\subsection{Inspection}

This section contains results of the inspection performed on the codebase, if any was deemed necessary.

\IfFileExists{build/inspection.tex}{
   \input{build/inspection.tex}
}{
    No inspection was performed.
}

\subsection{Demonstration}

This section reports on the demonstration of the system, if any was performed.

\IfFileExists{build/demonstration.tex}{
   \input{build/demonstration.tex}
}{
  No demonstration was performed.
}


\chapter{Performance Verification}

% following https://gitlab.cta-observatory.org/cta-computing/dpps/aiv/qa-reports/-/blob/main/excel-template/MetricsSummary_DPPS_REL0.1_Subsystem_draft1.xlsx?ref_type=heads

\IfFileExists{build/performance_verification.tex}{
   \input{build/performance_verification.tex}
}{
  No performance verification was performed.
}

\printglossaries

\appendix

\chapter{Supplementary Information}

\section{Detailed dependencies}\label{sec:detailed-dependencies}

This section provides detailed information about the dependencies (recursively) of the \ApplicationName{}. AIV dependencies are the same as in Section \ref{sec:dependencies}.

\small
\IfFileExists{build/dependencies_detailed.tex}{
    \input{build/dependencies_detailed.tex}
}{
    \todo[inline]{dependencies_detailed.tex is missing: this file should contain the detailed list of dependencies, and is generated by the included script.}
}



\section{Tests not directly linked to Use Cases and Requirements}

This section describes all automated subsystem tests that are not directly linked to Use Cases or Requirements.


\IfFileExists{build/unittests.tex}{
  \small
  \input{build/unittests.tex}
}{
    \todo[inline]{unittests.tex is missing: this file should contain the results of unit tests, and is generated by the included script from the CI test results.}
}

\subsection{Coverage}

Alternative unit test coverage assessment is one of the software quality metrics \citeapplicable{\ReferenceQAPlan}.

\IfFileExists{build/coverage.tex}{
  \small
   \input{build/coverage.tex}
}{
  \todo[inline]{coverage.tex is missing: this file should contain the results of the coverage tests, and is generated by the included script from the CI test results.}
}

\section{Test report build version}

\input{build/toolkitinfo.tex}

\end{document}
