Table of Contents

Preventing unnecessary costs as a user

Important

This section includes information that is only applicable to Skyline employees.

In this tutorial, you will learn how to prevent unnecessary costs when using the QAOps system by learning how to clean up used DaaS servers.

You will start a test run that is expected to fail and then remove the related server to limit resource usage.

Expected duration: 5 minutes.

Prerequisites

Overview

Step 1: Download, install, and verify the QAOps tool

Note

If you have already downloaded the QAOps tool for an earlier tutorial, skip this step.

  1. Open a Command Prompt, Bash, or PowerShell window.

  2. Check if you have nuget.org as a known NuGet source:

    dotnet nuget list source
    
  3. Verify that the output contains nuget.org [Enabled].

    Note

    The first time you run a dotnet command on a computer, you will see a welcome message. The output of your command is displayed below that message.

  4. If your sources do not contain nuget.org, add it with the following command. Otherwise, skip this step.

    dotnet nuget add source https://api.nuget.org/v3/index.json -n "nuget.org"
    
  5. Install the QAOps tool:

    dotnet tool install skyline.dataminer.qaops --global
    
  6. Verify that the tool is available:

    dataminer-qaops --help
    

    The command output will display a description of the tool and the available commands.

Note

If you see the exception "Unable to load the service index for source ...", one of your configured NuGet sources may be unreachable or may have expired credentials.

To continue this tutorial, you can temporarily remove the failing source and add it again later when needed:

dotnet nuget remove source "NameOfSource"

Step 2: Find the unique test and configuration identifiers

  1. In the QAOps User app (i.e., the green QAOps app), go to the Configurations page.

  2. Select Demo Configuration and Demo Test Suite - Failing Tests.

    This is a test suite that has been configured to produce a failing test.

  3. Copy the configuration ID and save it in a text file.

  4. Copy the test suite ID and save it in a text file.

Step 3: Create a token

  1. In the QAOps User app, go to the Tokens page.

  2. In the top-left corner, click Create Token .

  3. Enter a name for the token.

  4. Select the scope that matches the ".execute" scope for the Demo Configuration.

  5. Click Generate Token.

  6. Wait until the token value is shown.

  7. Copy the token value and save it in a text file.

    For production environments, use a key vault solution.

Step 4: Trigger the test run

  1. Open a Command Prompt, Bash, or PowerShell window.

  2. Run the following command, after replacing the placeholders as indicated below, making sure to keep the double quotes around the TOKEN value:

    dataminer-qaops test-run --token "TOKEN" -t TESTSUITE -c CONFIGURATION -tags MYNAME -san saqaopssandbox
    
    • TOKEN: The token value you copied earlier. Make sure this value is enclosed in double quotes.

    • TESTSUITE: The test suite ID you copied earlier.

    • CONFIGURATION: The configuration ID you copied earlier.

    • MYNAME: Your name, nickname, or another identifier that helps you find your request.

Important

For production systems, leave out the -san argument.

Step 5: Verify that the request was received

  1. In the QAOps User app, go to the Overview page.

  2. Locate your tag in the list.

  3. Use the top filter to find your request more quickly.

  4. Wait until the test run is finished.

Step 6: Find the test run results and delete the server used for the test run

  1. In the QAOps User app, go to the Configurations page.

  2. Select Demo Configuration and Demo Test Suite - Failing Tests.

  3. Use your tags to find your test run, and then select it.

  4. Locate the server information in the top-right corner.

    This shows which server was used. It should indicate that the server is marked for deletion in four or more days.

  5. Click the delete icon for the server.

  6. Verify that the "Marked For Deletion" timestamp changes to the current UTC time.

    After a few minutes, the server information will disappear, indicating that the server has been removed and you have successfully prevented unnecessary costs.

Tip

In production, only click the delete button after you have finished debugging and resolving the cause of the failing test.