Record sessions

2 minute read

Before you start recording test sessions, consider your Test Session Layouts.

CloudBees Smart Tests uses your test results from each test session to provide testing insights and recommendations.

After running the record build command, execute the record session command to create test sessions in your workspace.

The general structure of this command is as follows:

smart-tests record session --build <BUILD NAME> --test-suite <TEST SUITE NAME> > smart-tests-session.txt

Record a session

  1. Run the record session command in your terminal. For example:

    {PRODUCT} record session --build "Build 1" --test-suite "e2e" > smart-tests-session.txt
  2. After running the record session command, view your test sessions in the CloudBees Smart Tests dashboard.

    The dashboard will display empty test session(s), until the record tests command is run. Once that command is executed, the dashboard will populate with test sessions, test results, and insights.

    Test session tab on dashboard
    Figure 1. Test Session tab on dashboard
  3. Select a test session to view the session details.

    1. View session details using the dashboard. Such as;

      1. Test session summary (Build name, flavors, test suite, session duration, and more.)

      2. Test session details (Filters specific to the session, such as issues, failed tests, and more.)

      3. (Optional) Select View in Jenkins to export and view test details in a Jenkins file.

      4. (Optional) Select the three-dots to download the test session details to a CSV file.

    2. View test details using the filters. Such as;

      1. Select Issues to view the issues related to the test session.

        For more information, refer to Intelligent Test Failure Diagnostics.

      2. Select Failed tests to view the failed tests in the test session.

      3. Select Flakes to view which tests were flaky in the test session.

        For more information, refer to Test status definitions.

      4. Select Commits to view the details and number of commits related to the test session.

  4. Select View Logs to view the session logs. The Log Search tab on the dashboard displays.

    1. Select the desired log file to view the session logs related to the test session. For more information, refer to Attach log files to test sessions.

Test status definitions

The following define the status criteria used in the test session details:

  • Success: A test the passed.

  • Failure: A test that failed in all executions.

  • Flake: A test failure that eventually passed after several retries within the same test session.

  • Skip: A test that was not executed.

For more information about test sessions, refer to Test session layouts.