Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2020.2

...

Code Block
languagetext
suppression-begin
file: <FILE>
line: <LINE NUMBER>
rule-id: <RULE ID>
test-id: <TEST CASE ID> 
message: <TASK MESSAGE>
reason: <REASON FOR SUPPRESSION>
author: <SUPPRESSION AUTHOR>
suppression-end

The following table describes the fields supported in the parasoft.suppress file.

Scroll Table Layout
orientationdefault
sortDirectionASC
repeatTableHeadersdefault
widths35%,35%,30%
sortByColumn1
tableStylingconfluence
sortEnabledfalse
cellHighlightingtrue

...

Specifies the name of the test file. 

...

Specifies the line number in the code where the violation occurred.  

This field applies to static analysis only.

Note that if the line number changes, i.e., updates to the code changes where the violation occurs, the suppression will become invalid.

...

Specifies the code analysis rule ID that reported the violation. 

This field applies to static analysis only.

...

Specifies the test ID. This enables you to target specific tests within the test file to suppress. The test ID appears in the id attribute of the <Test> within the XML report. 

This field applies to functional test execution.

...

Specifies the justification for suppressing the violation or test failure.

If it is determined that the task is reported as a false positive, begin the statement with false positive so that the violation or failure is excluded from compliance reports if your organization uses Parasoft DTP.

...

The following properties must match task properties for the suppression to be valid:

  • file 
  • message 
  • test-id (functional testing) or rule-id (static analysis)

Suppressions that only match one or two of the fields will not be applied. 

Example Suppression File

SOAtest does not distinguish test cases by ID. All tasks from the same .tst file with the same message will suppressed. The following example shows a suppression file containing two functional test step suppressions:

Code Block
languagetext
suppression-begin
file: com.parabank.login.tests_testParabank_parasoft_com202007301253532.tst
message: The value of the property "balance" has changed from "5022.93" to "-2692".
reason: The return value does not need to be tested
author: user1
suppression-end

suppression-begin
file: com.parabank.login.tests_testParabank_parasoft_com202007301253532.tst
message: The value of the property "id" has changed from "13344" to "12345".
reason: The return value does not need to be tested
author: user1
suppression-end

Working with Deprecated Suppressions

Storing suppressions in the XML-style format locally or on Team Server is deprecated. Instead, suppressions are stored in the parasoft.suppress file. You can create suppressions using SOAtest's IDE functionality (see Suppressing Tasks) or by manually adding them to the parasoft.suppress file (see Manually Defining Suppression Files). Suppressions stored in deprecated format are still applied to your code and can be reviewed in the deprecated Suppressions view, but you can use the suppression migration functionality to transfer them to the parasoft.suppress file format.    

Migrating Suppressions from Deprecated Format

  1. Choose Parasoft > Show View > Suppressions (deprecated) from the main menu to open the deprecated Suppressions view.
  2. Choose Migrate suppressions... from the menu.
  3. Confirm the migration when prompted.

One of the following scenarios will be applied.

Connected to Team Server 

If connected to Team Server, SOAtest checks for team suppressions stored on Team Server and not the local workspace.

Image Removed

  • Deprecated team suppressions detected by SOAtest will be converted to plain text and saved in the parasoft.suppress file(s) located in the same location as the corresponding source file(s).
  • Deprecated team suppressions will continue to be available on Team Server.
  • Deprecated team suppression will remain in the Suppressions (deprecated) view until removed manually (see Removing Suppressions).

Suppressions stored on Team Server that point to remote URLs (such as http://mycompany.com/dir/file.html) will not be migrated. Suppressions containing URLs will only be created for static analysis results obtained by running a Scanning Tool or a browser test scenario (see Web Tools). You will need to migrate the suppressions manually by adding them to the parasoft.suppress file.

Local Workspace

If not connected to Team Server, SOAtest checks for suppressions stored in the local workspace and not Team Server.

Image Removed

  • Deprecated local suppressions detected by SOAtest will be converted to plain text and saved in the parasoft.suppress file(s) located in the same location as the corresponding source file(s).
  • A backup file that contains local suppressions in the deprecated format is created. The location of the file is printed to the console.
  • Deprecated local suppressions are removed from the workspace and from the deprecated Suppressions view.

Restoring Deprecated Local Suppressions from Backup File

  1. Close your IDE.
  2. Go to the location where the backup file is stored (the location is printed to the console). It contains a local_suppressions_backup.zip file.

  3. Extract the contents of local_suppressions_backup.zip to the same location.

You can re-migrate restored local suppressions on next IDE startup.

Enabling Team Server Suppressions (Deprecated)

Enabling Team Server Suppressions (Deprecated)

Storing suppressions on Team Server, as well as the Suppressions view, is deprecated starting with SOAtest 2020.2. You can The Suppressions view associated with viewing XML-style suppressions is deprecated, but you can enable Team Server suppressions and view suppressions that were created with an older version of SOAtest from the Suppressions (deprecatedDeprecated) view:

  1. Choose Parasoft > Show View > Suppressions (deprecated) from the main menu.
  2. Choose Enable deprecated suppressions from the ellipses menu.
    Image RemovedImage Added 

Removing Suppressions

...