You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Doc/LatexTP/TPCI_SEDRAInria.tex
+93-77
Original file line number
Diff line number
Diff line change
@@ -270,9 +270,7 @@ \subsection{\homeworkSectionName} % Make a subsection with the custom name of th
270
270
% To have just one problem per page, simply put a \clearpage after each problem
271
271
\begin{homeworkProblem}[Java Exercice]
272
272
273
-
\section{Local Test Part}
274
-
275
-
\subsection{Preamble}
273
+
\section{Preamble}
276
274
277
275
To go through this exercise, you will need to install
278
276
\begin{itemize}
@@ -283,9 +281,9 @@ \subsection{Preamble}
283
281
284
282
You will also need an account on both gforge.inria.fr and ci.inria.fr and be a member of the tpcisedra project.
285
283
286
-
\subsection{Setup}
284
+
\section{Setup}
287
285
288
-
\subsubsection{Create a personal copy of the git repository from INRIA forge and clone it}
286
+
\subsection{Create a personal copy of the git repository from INRIA forge and clone it}
289
287
First, you will create your personal \texttt{git} repository on the INRIA forge as a branch of the main repository for the \texttt{tpcisedra} project~:
290
288
\begin{itemize}
291
289
\item Go to \url{https~://gforge.inria.fr/projects/tpcisedra/}
@@ -336,7 +334,7 @@ \subsubsection{Create a personal copy of the git repository from INRIA forge and
336
334
\item A file \texttt{SphereTest.java} implementing its test class \texttt{SphereTest}.
337
335
\end{itemize}
338
336
339
-
\subsubsection{Check that you can build the project}
337
+
\subsection{Check that you can build the project}
340
338
\begin{lstlisting}
341
339
$ pwd
342
340
yourpath/tpcisedra/java
@@ -353,9 +351,9 @@ \subsubsection{Check that you can build the project}
353
351
354
352
355
353
%--------------------------------------
356
-
\subsection{Testing your code}
354
+
\section{Testing your code locally}
357
355
358
-
\subsubsection{Run the (single) test}
356
+
\subsection{Run the (single) test}
359
357
\begin{lstlisting}
360
358
$ mvn test
361
359
\end{lstlisting}
@@ -377,7 +375,43 @@ \subsubsection{Run the (single) test}
\section{Testing your code remotely on ci.inria.fr}
382
+
383
+
\subsection{Log into the project's Jenkins instance}
384
+
Connect to the INRIA Continuous Integration web portal~: \url{https://ci.inria.fr/} \\
385
+
Log in and click \textbf{\texttt{Dashboard}} in the top menu \\
386
+
You should have been added to project \textbf{\texttt{TPCISedRa}}, click on the \textbf{\texttt{Jenkins}} button \\
387
+
You may be prompted to log into \texttt{Jenkins}, use the same login/passwd as for the ci portal
388
+
389
+
\subsection{Create a new Jenkins item}
390
+
From our \texttt{Jenkins} dashboard page (\url{https://ci.inria.fr/tpcisedra/}), click \textbf{\texttt{New Item}} in the menu on the left
391
+
Provide a name for this new item (avoid spaces since it is likely to lead to errors) and select \textbf{\texttt{Maven project}}
392
+
393
+
\subsection{Git configuration}
394
+
In the new item's configuration page (which you will be redirected to after clicking \textbf{\texttt{OK}} on the \texttt{New Item} page), choose \texttt{git} as your \textbf{\texttt{Source Code Manager}} and copy the \emph{anonymous} url to your personal repository into the appropriate field~:
In the \textbf{\texttt{Build}} section, change the root POM path to \texttt{java/pom.xml} and type \texttt{test} in \textbf{\texttt{Goals and options}} section.
402
+
403
+
\subsection{Save and run}
404
+
Click \textbf{\texttt{Save}} at the bottom of the page \\
405
+
Click \textbf{\texttt{Build Now}} in the menu on the left
406
+
407
+
\subsection{Check the output}
408
+
In the \textbf{\texttt{Build History}} on the left, click on the last build (hopefully \#1), then select \textbf{\texttt{Console Output}} \\
409
+
You can also check the \textbf{\texttt{Test Result}}
410
+
411
+
412
+
413
+
%--------------------------------------
414
+
\section{Exercice 1}
381
415
382
416
Have a look at the code of the method \texttt{Sphere::computeVolume()}.\\
383
417
To do so, edit \texttt{tpcisedra/java/src/main/java/fr/inria/sed/Sphere.java}.
@@ -392,7 +426,7 @@ \subsubsection{Exercice 1}
392
426
393
427
We might want the value~: \verb?4 * Math.PI / 3? to be computed once and for all.
\section{Exercice 3bis - Coverage Report on Jenkins}
552
+
553
+
\subsection{Adding build feedback}
554
+
One of the good things with \texttt{Jenkins} is its ability to nicely present your test results. \\
555
+
The tools we used to run tests and code quality checks have been selected based on the availability of the corresponding \texttt{Jenkins} plugins.
556
+
557
+
\subsection{Add coverage report}
558
+
\begin{itemize}
559
+
\item Go back to your item's configuration page (use the menu on the left)
560
+
\item Replace your build's \textbf{\texttt{Goals and options}} with \texttt{cobertura:cobertura -Dcobertura.report.format=xml}
561
+
\item Click on \textbf{\texttt{Add post-build action}} and select \textbf{\texttt{Publish Cobertura Coverage Report}} from the drop-down menu, your \textbf{\texttt{Cobertura xml report pattern}} is \texttt{**/target/site/cobertura/coverage.xml} (it is the example provided below the field)
562
+
\item Save and Run the test
563
+
\item Check the output~: in the \texttt{Build History} on the left, click on the last build, you should have a new entry named \textbf{\texttt{Coverage Report}}, have a look at it
564
+
\end{itemize}
565
+
566
+
567
+
568
+
\section{Add a new class to our project}
509
569
510
570
Let's add a new class \texttt{Alphabet} and its test class \texttt{AlphabetTest} to our project
511
571
\begin{lstlisting}
512
572
$ git merge alpha
513
573
\end{lstlisting}
514
574
515
575
516
-
\subsubsection{Exercice 4}
576
+
\section{Exercice 4}
517
577
\begin{itemize}
518
578
\item Generate and visualize the corresponding coverage report
519
579
\item Make what changes are necessary to achieve 100\% test coverage
580
+
\item Check that you get the same results on Jenkins
520
581
\end{itemize}
521
582
522
583
%--------------------------------------
523
-
\subsection{Stylecheck}
584
+
\section{Stylecheck}
524
585
525
-
\subsubsection{Run a style checker}
586
+
\subsection{Run a style checker}
526
587
527
588
Let's try and run a style checker~:
528
589
\begin{lstlisting}
@@ -532,9 +593,9 @@ \subsubsection{Run a style checker}
532
593
\end{lstlisting}
533
594
We get plenty of errors with the default style \verb?sun_checks.xml?.
534
595
535
-
Our coding style is close to Google style than it is to Sun style.
596
+
Our coding style is closer to Google style than it is to Sun style.
536
597
537
-
\subsubsection{Run Google style checker}
598
+
\subsection{Run Google style checker}
538
599
539
600
Try running with Google checks (provided by the plugin)
540
601
\begin{lstlisting}
@@ -551,7 +612,9 @@ \subsubsection{Run Google style checker}
551
612
552
613
It's getting better but we might want to make a few changes to this default behaviour.
553
614
554
-
\subsubsection{Exercice 5}
615
+
\section{Exercice 5}
616
+
617
+
\subsubsection{TODO~:}
555
618
556
619
\begin{itemize}
557
620
\item Retrieve a local copy of google checks
@@ -563,7 +626,7 @@ \subsubsection{Exercice 5}
563
626
\item You may also consider removing trailing underscores from data members or amending \texttt{checkstyle.xml}
564
627
\end{itemize}
565
628
566
-
\subsubsection{[Optional] Integrate checkstyle to your reporting local website}
629
+
\section{Integrate checkstyle to your reporting local website}
567
630
568
631
Add the following to the file \texttt{pom.xml}
569
632
\begin{lstlisting}
@@ -580,10 +643,10 @@ \subsubsection{[Optional] Integrate checkstyle to your reporting local website}
580
643
581
644
The check style report is now included in the build lifecycle (\textbf{\texttt{site}} phase).
\subsection{Log into the project's Jenkins instance}
606
-
Connect to the INRIA Continuous Integration web portal~: \url{https://ci.inria.fr/} \\
607
-
Log in and click \textbf{\texttt{Dashboard}}in the top menu \\
608
-
You should have been added to project \textbf{\texttt{TPCISedRa}}, click on the \textbf{\texttt{Jenkins}} button \\
609
-
You may be prompted to log into \texttt{Jenkins}, use the same login/passwd as for the ci portal
610
-
611
-
\subsection{Running your first test on CI}
612
-
From our \texttt{Jenkins} dashboard page (\url{https://ci.inria.fr/tpcisedra/}), click \textbf{\texttt{New Item}} in the menu on the left
613
-
Provide a name for this new item (avoid spaces since it is likely to lead to errors) and select \textbf{\texttt{Maven project}}
614
-
615
-
\subsubsection{Git configuration}
616
-
In the new item's configuration page (which you will be redirected to after clicking \textbf{\texttt{OK}}), choose \texttt{git} as your \textbf{\texttt{Source Code Manager}} and copy the \emph{anonymous} url to your personal repository into the appropriate field~:
In the \textbf{\texttt{Build}} section, change the root POM path to \texttt{java/pom.xml} and type \texttt{test} in \textbf{\texttt{Goals and options}} section.
624
-
625
-
\subsubsection{Save}
626
-
627
-
\subsubsection{Run the test}
628
-
Click \textbf{\texttt{Build Now}} in the menu on the left
629
-
630
-
\subsubsection{Check the output}
631
-
In the \textbf{\texttt{Build History}} on the left, click on the last build (hopefully \#1), then select \textbf{\texttt{Console Output}} \\
632
-
You can also check the \textbf{\texttt{Test Result}}
633
-
634
-
\subsection{Adding build feedback}
635
-
One of the good things with \texttt{Jenkins} is its ability to nicely present your test results. \\
636
-
The tools we used to run tests and code quality checks have been selected based on the availability of the corresponding \texttt{Jenkins} plugins.
637
-
638
-
\subsubsection{Add coverage report}
639
-
\begin{itemize}
640
-
\item Go back to your item's configuration page (use the menu on the left)
641
-
\item Replace your build's \textbf{\texttt{Goals and options}} with \texttt{cobertura:cobertura -Dcobertura.report.format=xml}
642
-
\item Click on \textbf{\texttt{Add post-build action}} and select \textbf{\texttt{Publish Cobertura Coverage Report}} from the drop-down menu, your \textbf{\texttt{Cobertura xml report pattern}} is \texttt{**/target/site/cobertura/coverage.xml} (it is the example provided below the field)
643
-
\item Save and Run the test
644
-
\item Check the output~: in the \texttt{Build History} on the left, click on the last build, you should have a new entry named \textbf{\texttt{Coverage Report}}, have a look at it
645
-
\end{itemize}
646
-
647
-
\subsubsection{Add checkstyle report}
663
+
\subsubsection{TODO~:}
648
664
\begin{itemize}
649
665
\item Go back to your item's configuration page and add \\
650
666
\texttt{checkstyle:checkstyle -Dcheckstyle.config.location=google\_checks.xml} to your build's \textbf{\texttt{Goals and options}}
0 commit comments