Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(STONEINTG-901): added debugging page for integration tests #93

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/modules/ROOT/images/activityview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/edittest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/successfulretest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/testfailed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/testview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/how-tos/_nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
**** xref:how-tos/testing/integration/adding.adoc[Adding an integration test]
**** xref:how-tos/testing/integration/creating.adoc[Creating a custom integration test]
**** xref:how-tos/testing/integration/editing.adoc[Editing integration tests]
**** xref:how-tos/testing/integration/debugging.adoc[Debugging an integration test]
**** xref:how-tos/testing/integration/rerunning.adoc[Rerunning an integration test]
**** xref:how-tos/testing/integration/override-snapshots.adoc[Creating an override snapshot]
** xref:how-tos/metadata/index.adoc[Inspecting provenance and attestations]
Expand Down
36 changes: 36 additions & 0 deletions docs/modules/ROOT/pages/how-tos/testing/integration/debugging.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
= Debugging Integration Tests

In the event of an integration test scenario failing, there are a number of steps to take in order to debug the issue before rerunning the test in question. These steps are outlined below.


.Prerequisites
- You have a snapshot that has completed all build-time tests. These must be completed before attempting to debug the failed test.

- You have access to the {ProductName} UI in order to view the logs of the failed test.

.Procedure

. Identify the IntegrationTestScenario that has failed
* Open the {ProductName} and navigate to Application/your_application_name/activity
* Select "Pipeline Runs" under "Activity By"
* Your view should look similar to the below image.

+
image::activityview.png[role="border" alt="Activity View"]

. Click on the pipeline run that has a status of "Failed". This will take you to a detailed view of the failed run.

. Examine the "Log Snippet" section on the right side of this page. It contains the most recent error returned by the integration test. For more comprehensive logs, click on "See Logs". See the below image for reference.

+
image::testfailed.png[role="border" alt="Test Failed"]

. In this example the output suggests that the pipelineRun is missing an expected parameter, "username". To edit the integration test, follow the procedure provided xref:/how-tos/testing/integration/editing.adoc[here].

. Rerun the test by following the steps xref:/how-tos/testing/integration/rerunning.adoc[here].

. Once the test has been rerun, verify that the test has passed by checking the "Pipeline Runs" tab in the {ProductName} console. The status of the test should now be "Succeeded". See the below image for reference.

+
image::successfulretest.png[role="border alt="Successful Retest"]

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ See also xref:/how-tos/configuring/rerunning.adoc[Retriggering build pipelines].
+
image::snapshot.png[role="border" alt="IntegrationTestScenario Snapshot"]

. To rerun within the UI, click on the three vertical dots on the right side of the details page mentioned above. From the expanded menu, select "Rerun". Alternatively, follow the below steps to rerun via the CLI.

. Label the snapshot with `test.appstudio.openshift.io/run`, assigning the scenario name you wish to rerun as its value.

+
Expand Down
Loading