List tests in an SKF project

‘list’ goal (squash-ta:list)

The list goal generates a json file representing the test tree of the current project. To generate this list, run at the root of your project (where the pom.xml of your project is located) the command :

mvn squash-ta:list

The generated json file is named testTree.json and is created in <root_project_path>/target/squashTA/test-tree directory.

Listing test JSON report

{
  "timestamp": "2014-06-17T09:48:19.733+0000",
  "name": "tests",
  "contents": [
    {
      "name": "sample",
      "contents": [
        {
          "name": "test-OK.tf",
          "contents": null
        }
      ]
    },
    {
      "name": "sample2",
      "contents": [
        {
          "name": "placeHolder.tf",
          "contents": null
        },
        {
          "name": "test-OK.tf",
          "contents": null
        }
      ]
    },
    {
      "name": "placeHolder.tf",
      "contents": null
    },
    {
      "name": "test-KO-db-verification.tf",
      "contents": null
    },
    {
      "name": "test-KO-sahi.tf",
      "contents": null
    },
    {
      "name": "test-OK.tf",
      "contents": null
    }
  ]
}

‘list’ goal with Metadata

If there are Squash metadata in the current test project, the goal “list” searches and checks if all metadata in a SKF project respect the conventions for writing and using Squash TF metadata. (See Metadata section for more information about Metadata syntax conventions)

The goal will check through the project, collect all the metadata error(s) if any and lead to a FAILURE. Otherwise, a SUCCESS result will be obtained.

List build SUCCESS

Metadata error(s), if found, will be grouped by test names.

List build FAILURE

Listing test JSON report with Metadata

If the build is successful, the generated report (JSON file) will contain the metadata associated with each of the test scripts.

{
  "timestamp": "2014-06-17T09:48:19.733+0000",
  "name": "tests",
  "contents": [
    {
      "name": "sample",
      "metadata" : {},
      "contents": [
        {
          "name": "test-OK.ta",
          "metadata" : {
            "linked-TC": ["guid-1", "guid-2"],
            "key2": null,
            "key3": ["value"]
          },
          "contents": null
        }
      ]
    },
    {
      "name": "test-KO.ta",
      "metadata" : {},
      "contents": null
    }
  ]
}

Disable Metadata when test listing

If there are Metadata in your project but you want to ignore them during the project test listing, then insert tf.disableMetadata property after the goal “list”

mvn squash-ta:list -Dtf.disableMetadata=true

or as a property in the pom.xml file

<properties>
   <tf.disableMetadata>true</tf.disableMetadata>
</properties>

The generated report (JSON file) will then NO LONGER contain the metadata.

{
  "timestamp": "2014-06-17T09:48:19.733+0000",
  "name": "tests",
  "contents": [
    {
      "name": "sample",
      "contents": [
        {
          "name": "test-OK.ta",
          "contents": null
        }
      ]
    },
    {
      "name": "test-KO.ta",
      "contents": null
    }
  ]
}

Note

SKF has also a deprecated test-list goal. It generates the test list in the console / log and through the exporters configured in pom.xml (html, surefire)