Skip to content

Commit 224c388

Browse files
authored
Merge pull request #134 from konflux-ci/testing-farm
Instructions for how to test with testing farm
2 parents 93bd5e9 + 81a08b6 commit 224c388

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

docs/modules/ROOT/pages/how-tos/_nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
**** xref:how-tos/testing/integration/rerunning.adoc[Rerunning an integration test]
2626
**** xref:how-tos/testing/integration/override-snapshots.adoc[Creating an override snapshot]
2727
**** xref:how-tos/testing/integration/choosing-contexts.adoc[Choosing when to run certain Integration Tests]
28+
**** Third Parties
29+
***** xref:how-tos/testing/integration/third-parties/testing-farm.adoc[Testing with Testing Farm]
2830
** xref:how-tos/metadata/index.adoc[Inspecting provenance and attestations]
2931
*** xref:how-tos/metadata/sboms.adoc[Inspecting SBOMs]
3032
*** xref:how-tos/metadata/attestations.adoc[Inspecting artifact attestations]

docs/modules/ROOT/pages/how-tos/testing/integration/adding.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ NOTE: By default, all integration test scenarios are mandatory and must pass. A
3131

3232
. Select *Add integration test*.
3333

34-
. To start building a new component, either open a new pull request (PR) that targets the tracked branch of the component in the GitHub repository, or comment '/retest' on an existing PR.
35-
3634
.Verification
3735

36+
To start building a new component, either open a new pull request (PR) that targets the tracked branch of the component in the GitHub repository, or comment '/retest' on an existing PR.
37+
3838
When the new build is finished:
3939

4040
. Go to the *Integration tests* tab and select the highlighted name of your test.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
= Testing Farm
2+
3+
In this guide, you'll learn how to xref:/how-tos/testing/integration/adding.adoc[add a custom integration test] in {ProductName} that uses link:https://docs.testing-farm.io/[Testing Farm] as a third-party backend for test execution.
4+
5+
.Prerequisites
6+
7+
. You have xref:/how-tos/creating.adoc[created an application] in {ProductName}
8+
9+
. You have a Testing Farm API key, which can be acquired by following the link:https://docs.testing-farm.io/Testing%20Farm/0.1/onboarding.html[Testing Farm onboarding guide].
10+
11+
. You have or are ready to create a git repository with link:https://fmf.readthedocs.io/[fmf] files suitable for use with the link:https://tmt.readthedocs.io/[tmt] testing tool. This is the testing technology used by Testing Farm. If you don't have fmf tests already prepared, you can use our tmt link:https://github.com/ralphbean/tmt-hello-world[hello world repository].
12+
13+
.Procedure
14+
15+
You need to perform two major steps. Upload your Testing Farm API key, and register an *Integration test* to send requests to the Testing Farm API. Complete the following steps in the {ProductName} console:
16+
17+
.Procedure - Upload your Testing Farm API key
18+
19+
Follow the instructions in the xref:/how-tos/configuring/creating-secrets.adoc[creating secrets] guide, with the following details:
20+
21+
. For **Secret name**, enter `testing-farm-secret`.
22+
23+
. Under **Key/value secret**, expand **Key/value 1**, then enter the key name `testing-farm-token`.
24+
25+
NOTE: Be sure that the secret name is `testing-farm-secret` and the key name is `testing-farm-token`. The link:https://github.com/ralphbean/testing-farm-tekton/blob/main/tasks/testing-farm.yaml[tekton task] expects the secret and key name to be named these strings exactly.
26+
27+
. For **Upload the file with value for your key or paste its contents**, paste the value of your token into the space under **Upload**.
28+
29+
.Procedure - Registering the Integration Test
30+
31+
Follow the instructions in the xref:/how-tos/testing/integration/adding.adoc[adding an integration test] guide, with the following details:
32+
33+
. In the *GitHub URL* field, enter `https://github.com/ralphbean/testing-farm-tekton`, which is a git repository containing a tekton pipeline and task that can send requests to the Testing Farm API.
34+
35+
. In the *Path in repository* field, enter `pipelines/testing-farm.yaml`, which refers to link:https://github.com/ralphbean/testing-farm-tekton/blob/main/pipelines/testing-farm.yaml[this path in the repo].
36+
37+
. Expand the *Parameters* field.
38+
39+
. Select *Add parameter*. For the *Name* field, enter `GIT_URL`. For the *Value* field, enter the url to the git repository that contains your *fmf* files. If you do not have any, try using our tmt link:https://github.com/ralphbean/tmt-hello-world[hello world repository] to try it out.
40+
41+
. Optional: Select *Add parameter*. For the *Name* field, enter `COMPOSE`. For the *Value* field, enter a valid Testing Farm compose identifier. Try `Fedora-40`.
42+
43+
.Verification
44+
45+
To start building a new component, either open a new pull request (PR) that targets the tracked branch of the component in the GitHub repository, or comment '/retest' on an existing PR.
46+
47+
When the new build is finished:
48+
49+
. Go to the *Integration tests* tab and select the highlighted name of your test.
50+
51+
. Go to the *Pipeline runs* tab of that test and select the most recent run.
52+
53+
. You should be able to find the testing-farm URLs in the logs.
54+
55+
. xref:/how-tos/testing/integration/editing.adoc[Edit the integration test] if it is not properly configured.

0 commit comments

Comments
 (0)