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
Access to https://qaops-sandbox.skyline.be. This "QAOps Sandbox Environment" environment should be used for every QAOps tutorial.
Note
Please contact support.boost@skyline.be to receive a username and password for access to the Sandbox system.
dotnet 8.0 SDK is required, even if a higher SDK version is already installed.
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.
Open a Command Prompt, Bash, or PowerShell window.
Check if you have
nuget.orgas a known NuGet source:dotnet nuget list sourceVerify that the output contains
nuget.org [Enabled].Note
The first time you run a
dotnetcommand on a computer, you will see a welcome message. The output of your command is displayed below that message.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"Install the QAOps tool:
dotnet tool install skyline.dataminer.qaops --globalVerify that the tool is available:
dataminer-qaops --helpThe 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
In the QAOps User app (i.e., the green QAOps app), go to the Configurations page.
Select Demo Configuration and Demo Test Suite - Failing Tests.
This is a test suite that has been configured to produce a failing test.
Copy the configuration ID and save it in a text file.
Copy the test suite ID and save it in a text file.
Step 3: Create a token
In the QAOps User app, go to the Tokens page.
In the top-left corner, click Create Token .
Enter a name for the token.
Select the scope that matches the ".execute" scope for the Demo Configuration.
Click Generate Token.
Wait until the token value is shown.
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
Open a Command Prompt, Bash, or PowerShell window.
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 saqaopssandboxTOKEN: 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
In the QAOps User app, go to the Overview page.
Locate your tag in the list.
Use the top filter to find your request more quickly.
Wait until the test run is finished.
Step 6: Find the test run results and delete the server used for the test run
In the QAOps User app, go to the Configurations page.
Select Demo Configuration and Demo Test Suite - Failing Tests.
Use your tags to find your test run, and then select it.
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.
Click the delete icon for the server.
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.