1161 Commits

Author SHA1 Message Date
Joel Brobecker
8a3b7be3fd .gitreview: set gerrit.defaultbranch to 22.0 [UA04-042] 2021-10-07 06:28:05 -07:00
Monika Kurovszky
3504870e15 U930-004: GNAThub Makefile change
Redefine MKDIR = install -d as MKDIR = mkdir -p

Change-Id: I80228f357d090eac6e1a9aa777c8fc6a8bfa8a55
2021-09-30 11:26:11 +02:00
Boris Yakobowski
05f77486bd U504-035 fix bug with utf8-encoded files under Windows
If the encoding is not specified, files opened under Windows are
assumed to be cp-1252 encoded, which is almost always wrong nowadays.
Force an utf-8 encoding when we initially open the file to read.

(Keeping in mind that we have backup code for latin1-encoded files.)

Change-Id: I3847b223ce36ae5c3a2df2d9fbcf7f8360678661
2021-09-21 16:47:31 +02:00
kurovszky
d52ff2a60a U803-019: Adapt sonar-scanner test for SQ 8.9.x LTS
Sonar scanner execution requires to provide login
   information for analysis results upload into SQ
   dashboard.

   Using default credentials for authenticate.

   Update the documentation with the latest supported
   SonarQube server and SonarScanner versions and add
   a note to inform that credentials are mandatory when
   sonar-scanner is executed.

Change-Id: I72623adccf44f5c043f3abe0005d7f352e7ad23a
2021-09-13 10:20:28 +02:00
kurovszky
c6c5dbb66d U803-019: Add support for SonarQube 8.9.x LTS
Change-Id: I7be0a00656dbffa2b5c4e308c70eaf791e168df1
Depends-On: Idd7d2f0a77b5ff5474c18afafbfc71a060417a4f
2021-09-09 15:12:24 +02:00
kurovszky
3f41e19f86 U805-025: Add --sonar-work-dir switch to GNAThub
The sonar-work-dir switch usage allows to specify
  the path to the folder that will be used for sonar
  scanner work by SonarQube's Ada plugin.

  Default behavior is kept unchanged. Hence, if this
  switch is not used then the default sonar folder
  is generated under obj/gnathub and this will be used
  for all SonarQube specific configurations.

  The documentation is updated with the new switch
  description.

  A specific test case is added.

Change-Id: I34c38f26b16132c78dd73c176417c6373c4ca948
2021-09-02 18:52:17 +02:00
Nicolas Setton
cb2630298c U723-025 Adjustment needed after move of the GNAThub dir
As a follow up to the previous change, adjust the location
of the GNAThub dir. Fixes the build of the documentation.

Change-Id: I10607c0602169167be9d9f93b599d299219121db
2021-07-30 09:26:56 +01:00
Nicolas Setton
34e17a64d6 U723-025 Reorganize Python files to support virtualenvs
A Python virtualenv might overwrite the site-packages entry
in sys.path; when this happens, plugin-runner.py can no longer
load GNAThub.py.

To address this, place GNAThub.py in the core directory rather
than in the Python install.

This means that tests can no longer simply rely on the GNAThub
module being available for testing - to make this available
to tests, set an environment variable COREDIR to point to the
directory containing this. (We could make this simpler by setting
the PYTHONPATH for all tests, but this presents the risk of
hiding setup problems where the python-runner.py would normally
not find the GNAThub module)

Simplify the structure in the process, removing src/lib and
placing all Python files under share/gnathub/core.

Simplify the Makefile accordingly.

Remove use of deprecated API in the testsuite driver.

Change-Id: I2574afd9560eba7ff9a6e0a98836d1a04b11c807
2021-07-29 10:28:48 +01:00
Adrien Boulanger
7e76088b2c U610-063: Fix crash for incremental mode without a database
Launching GNAThub with --incremental when the database doesn't
exist yet should still create it.

Change-Id: Idb24d1de9c9aed51e37c7a9651586ce3688aadf9
2021-07-12 14:20:35 +02:00
Monika Kurovszky
a699e780cd U608-008: GNAThub's gnatstack test baseline update
Change-Id: I2faa0a10e87faa3ac6e962bed15dc13f917e321b
2021-06-08 19:47:17 +02:00
Monika Kurovszky
ec00b70e9d U325-018: Update GNATdashboard documentation
Adding some details for the SonarQube integration
  part and the related specific plugins

Change-Id: Ic9d510e81beec7c06926cc510382e43165f74d51
2021-04-26 17:52:23 +02:00
Boris Yakobowski
c3423db03c U318-053 use -csv-out when calling CodePeer
This avoid problems when -show-header is specified in the project
file, and codepeer is called from GNATHub directly.

(This already works when codepeer calls gnathub which calls codepeer
thanks to a kludge.)

Change-Id: Ie042e70ab70cc853ef1804670ee9d746566cde4a
2021-04-21 11:49:04 +01:00
Monika Kurovszky
542901a4c5 U119-021: Update sonar-scanner test baseline
New rules added to Ada default profile since
  GNATstack plugin integration with SonarQube

Change-Id: I8dba85778bf798d19014aa0ea1993634a5e566c7
2021-04-06 11:05:51 +02:00
Monika Kurovszky
b2443f579f U119-021: Add GNATstack support for Sonar Ada plugin
GNATstack entities related issues are uploaded to
  SonarQube dashboard
  The severity is set as Info and no technical debt is
  is associated with it since no remediation
  effort is set

Change-Id: I0e34799943763c43edcd5bd0e11468a047a03cff
2021-03-30 12:23:32 +02:00
Elie Richa
c782b1a778 Update Surefire to e3 test report converter
* Mangle unsupported characters in test names
* Use only one line per test in summary report

Change-Id: Ia894385d0d0da76a35bff029feeb19ea6d7f28ad
TN: U326-060
2021-03-26 18:34:12 +00:00
Monika Kurovszky
5d2c5755ef U317-004: GNATcoverage plugin failure fix
The attributes "column_begin" and "column_end"
  are handled now for a line of the generated .xml
  report
  Default values are set to 1 for "column_end" and
  "column_begin"

Change-Id: I2c16b8ef21eb25542aa2ca3a9d76074c715beeab
2021-03-18 12:02:46 +01:00
Monika Kurovszky
129952e8cc NA24-024: GNAThub testing with SonarQube
Passing 'with-sonarqube' parameter

  Add sonar-scanner testing using SonarQube Web API

  sonar-scanner.py
      New test case is added for sonar-scanner
      When 'with-sonarqube' qualifier is used then
      SonarQube Web API is used to gather analysis
      results and compare with the expected ones.

Change-Id: If950fcbdb9172557cbf35e2c68483a6b9a9891a7
2021-03-01 15:20:11 +01:00
Monika Kurovszky
39e7692d95 U112-043: Spark2014 plugin fix
For the 2nd run of gnatprove to gather analysis
  results the --targs parameter are not passed which
  makes that the analysis results are not accurate
  in gnathub DB and in SonarQube analysis dashboard

  The fix will add --targs argument for the 2nd run
  and also handle the case where not both records
  are presents (flow and proof) in the generated
  .spark files

Change-Id: I85229fa03c6b6657303c330fc24860d13448529d
2021-02-04 17:34:13 +01:00
Monika Kurovszky
e4f9a94bd1 NA24-024: New --with-sonarqube qualifier
Add new qualifier to GNAThub testsuite to be able
   to run specific tests using SonarQube instance in
   order to add sonar-ada-pugin automated testing

Change-Id: If2925567ee4c6b49ade25fb0b3303b5ea76771bf
2021-02-02 18:05:46 +01:00
Monika Kurovszky
08e1e579a8 U201-008: Fixing typo in GNATdashboard user guide
Change-Id: I4ce68fbc3d0e41d76925cc34a6d512b967d4c52d
2021-02-01 12:15:07 +01:00
Monika Kurovszky
be4978957d TC10-028: GNATcoverage results in SonarQube
This is a rewritting of Matthieu Eyraud patch to
  consider GNATcoverage results as part of coverage
  of the code in SonarQube.

  The sonar-ada-plugin was displaying coverage data
  but only for gcov data.

  This fix is also to consider GNATcoverage data
  when it is present. If there is data for both tool,
  we will consider GNATcoverage data only as it is
  more precise.

Change-Id: Ie0e2dd8e013963dbfeab8104b1fcfa8888b3d084
2021-01-28 12:14:56 +01:00
Monika Kurovszky
b848ddb52c U115-023: Update of SPARK2014 profile for SonarQube
The spark2014.xml default rules profile contains
  the latest changes of gnatprove --list-categories
  output

  * Specific script is added to handle new format

  * Ada default profile is updated based on these
    changes

Change-Id: If8237ed1bf358b793ac4fea4f7e0d48b08461845
2021-01-26 18:00:19 +01:00
Monika Kurovszky
9405318e6a U112-043: Add multi-object dir support for Spark2014
GNATprove stores the .spark files in the
  "gnatprove" subfolder of the object dir for each
  project in the project tree.

  Spark2014 GNAThub plugin explored only the main
  project object dir folder to gather analysis
  results. Enhancing this behavior to explore all
  the .spark files of the gnatprove subfolder of the
  obejct dir of each project in the project tree and
  gather all analysis results.

  Add basic test to check gnathub database content.

Change-Id: I5d80b28663c491efe2989fc591bd31a3b85e3a38
2021-01-26 16:21:58 +01:00
Monika Kurovszky
ed3a43afd4 U115-032: Generate spark2014 default rules profile
Use gnatprove --list-categories to generate
  spark2014.xml

  Update default spark and ada profile for Sonar

Change-Id: Ice9c0b3ac426a4c105cd3f4b33b132de8804815c
2021-01-18 14:22:58 +01:00
Monika Kurovszky
2eb8d14c46 U112-043: fix SPARK plugin exception
Fix use of string pattern of byte-like object issue
 by changing open file mode to 'r' instead of 'rb'

Change-Id: Iecb8746b187b4cf1d380be0b83669f1159d3bc35
Depends-On: I17a7ad8da5203fe87043bc5dad89384a1d5e6889
2021-01-18 14:22:52 +01:00