Skip to content

Commit 12b06cd

Browse files
committed
ci: In test plans, prefix all relate variables with SR_
Signed-off-by: Sergei Petrosian <[email protected]>
1 parent 62ebcc1 commit 12b06cd

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

.github/workflows/tft.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,20 @@ jobs:
118118
ARTIFACTS_DIR_NAME: "tf_${{ github.event.repository.name }}-${{ github.event.issue.number }}_\
119119
${{ matrix.platform }}-${{ matrix.ansible_version }}_\
120120
${{ needs.prepare_vars.outputs.datetime }}/artifacts"
121-
ARTIFACT_TARGET_DIR: /srv/pub/alt/${{ vars.LINUXSYSTEMROLES_USER }}/logs
121+
ARTIFACT_TARGET_DIR: /srv/pub/alt/${{ vars.SR_LSR_USER }}/logs
122122
steps:
123123
- name: Set variables with DATETIME and artifact location
124124
id: set_vars
125125
run: |
126126
printf -v DATETIME '%(%Y%m%d-%H%M%S)T' -1
127127
ARTIFACTS_DIR_NAME="tf_${{ github.event.repository.name }}-${{ github.event.issue.number }}_\
128128
${{ matrix.platform }}-${{ matrix.ansible_version }}_$DATETIME/artifacts"
129-
ARTIFACTS_TARGET_DIR=/srv/pub/alt/${{ vars.LINUXSYSTEMROLES_USER }}/logs
129+
ARTIFACTS_TARGET_DIR=/srv/pub/alt/${{ vars.SR_LSR_USER }}/logs
130130
ARTIFACTS_DIR=$ARTIFACTS_TARGET_DIR/$ARTIFACTS_DIR_NAME
131-
ARTIFACTS_URL=https://dl.fedoraproject.org/pub/alt/${{ vars.LINUXSYSTEMROLES_USER }}/logs/$ARTIFACTS_DIR_NAME
131+
ARTIFACTS_URL=https://dl.fedoraproject.org/pub/alt/${{ vars.SR_LSR_USER }}/logs/$ARTIFACTS_DIR_NAME
132132
echo "DATETIME=$DATETIME" >> $GITHUB_OUTPUT
133-
echo "ARTIFACTS_DIR=$ARTIFACTS_DIR" >> $GITHUB_OUTPUT
134-
echo "ARTIFACTS_URL=$ARTIFACTS_URL" >> $GITHUB_OUTPUT
133+
echo "SR_ARTIFACTS_DIR=$SR_ARTIFACTS_DIR" >> $GITHUB_OUTPUT
134+
echo "SR_ARTIFACTS_URL=$SR_ARTIFACTS_URL" >> $GITHUB_OUTPUT
135135
136136
- name: Set commit status as pending
137137
if: contains(needs.prepare_vars.outputs.supported_platforms, matrix.platform)
@@ -160,18 +160,18 @@ jobs:
160160
git_ref: main
161161
pipeline_settings: '{ "type": "tmt-multihost" }'
162162
environment_settings: '{ "provisioning": { "tags": { "BusinessUnit": "system_roles" } } }'
163-
# Keeping ARTIFACTS_URL at the bottom makes the link in logs clickable
164-
variables: "ANSIBLE_VER=${{ matrix.ansible_version }};\
165-
REPO_NAME=${{ github.event.repository.name }};\
166-
GITHUB_ORG=${{ github.repository_owner }};\
167-
PR_NUM=${{ github.event.issue.number }};\
168-
ARTIFACTS_DIR=${{ steps.set_vars.outputs.ARTIFACTS_DIR }};\
169-
TEST_LOCAL_CHANGES=false;\
170-
LINUXSYSTEMROLES_USER=${{ vars.LINUXSYSTEMROLES_USER }};\
171-
ARTIFACTS_URL=${{ steps.set_vars.outputs.ARTIFACTS_URL }}"
163+
# Keeping SR_ARTIFACTS_URL at the bottom makes the link in logs clickable
164+
variables: "SR_ANSIBLE_VER=${{ matrix.ansible_version }};\
165+
SR_REPO_NAME=${{ github.event.repository.name }};\
166+
SR_GITHUB_ORG=${{ github.repository_owner }};\
167+
SR_PR_NUM=${{ github.event.issue.number }};\
168+
SR_ARTIFACTS_DIR=${{ steps.set_vars.outputs.SR_ARTIFACTS_DIR }};\
169+
SR_TEST_LOCAL_CHANGES=false;\
170+
SR_LSR_USER=${{ vars.SR_LSR_USER }};\
171+
SR_ARTIFACTS_URL=${{ steps.set_vars.outputs.SR_ARTIFACTS_URL }}"
172172
# Note that LINUXSYSTEMROLES_SSH_KEY must be single-line, TF doesn't read multi-line variables fine.
173-
secrets: "LINUXSYSTEMROLES_DOMAIN=${{ secrets.LINUXSYSTEMROLES_DOMAIN }};\
174-
LINUXSYSTEMROLES_SSH_KEY=${{ secrets.LINUXSYSTEMROLES_SSH_KEY }}"
173+
secrets: "SR_LSR_DOMAIN=${{ secrets.SR_LSR_DOMAIN }};\
174+
SR_LSR_SSH_KEY=${{ secrets.SR_LSR_SSH_KEY }}"
175175
compose: ${{ matrix.platform }}
176176
# There are two blockers for using public ranch:
177177
# 1. multihost is not supported in public https://github.com/teemtee/tmt/issues/2620
@@ -189,4 +189,4 @@ jobs:
189189
status: ${{ job.status }}
190190
context: ${{ matrix.platform }}|ansible-${{ matrix.ansible_version }}
191191
description: Test finished
192-
targetUrl: ${{ steps.set_vars.outputs.ARTIFACTS_URL }}
192+
targetUrl: ${{ steps.set_vars.outputs.SR_ARTIFACTS_URL }}

plans/README-plans.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This workflow uses Testing Farm's Github Action [Schedule tests on Testing Farm]
2121

2222
## Running Tests
2323

24-
You can run tests locally with the `tmt try` cli or remotely in Testing Farm.
24+
You can run tests locally with the `tmt try` cli or remotely in Testing Far.
2525

2626
### Running Tests Locally
2727

@@ -32,7 +32,7 @@ You can run tests locally with the `tmt try` cli or remotely in Testing Farm.
3232
2. Optionally modify environment variables to, e.g. run only specified test playbooks by modifying `SYSTEM_ROLES_ONLY_TESTS`.
3333
4. Enter `tmt try -p plans/test_playbooks_parallel <platform>`.
3434
This command identifies the `plans/test_playbooks_parallel.fmf` plan and provisions local VMs, a control node and a managed node.
35-
5. `tmt try` is in development and does not identify tests from URL automatically, so after provisioning the machines, you must type `t`, `p`, `t` from the interactive prompt to identify tests, run preparation steps, and run the tests.
35+
5. tmt try is in development and does not identify tests from URL automatically, so after provisioning the machines, you must type `t`, `p`, `t` from the interactive prompt to identify tests, run preparation steps, and run the tests.
3636

3737
### Running in Testing Farm
3838

plans/test_playbooks_parallel.fmf

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ provision:
1515
- name: managed-node2
1616
role: managed_node
1717
connection: system
18+
- name: managed-node3
19+
role: managed_node
20+
connection: system
1821
environment:
19-
ANSIBLE_VER: 2.17
20-
REPO_NAME: ssh
21-
PYTHON_VERSION: 3.12
22-
SYSTEM_ROLES_ONLY_TESTS: "" # tests_default.yml
23-
TEST_LOCAL_CHANGES: true
24-
PR_NUM: ""
25-
LINUXSYSTEMROLES_USER: ""
26-
LINUXSYSTEMROLES_DOMAIN: ""
27-
LINUXSYSTEMROLES_SSH_KEY: ""
28-
ARTIFACTS_DIR: ""
29-
ARTIFACTS_URL: ""
30-
LSR_TFT_DEBUG: false
22+
SR_ANSIBLE_VER: 2.17
23+
SR_REPO_NAME: ssh
24+
SR_PYTHON_VERSION: 3.12
25+
SR_ONLY_TESTS: "" # tests_default.yml
26+
SR_TEST_LOCAL_CHANGES: true
27+
SR_PR_NUM: ""
28+
SR_LSR_USER: ""
29+
SR_LSR_DOMAIN: ""
30+
SR_LSR_SSH_KEY: ""
31+
SR_ARTIFACTS_DIR: ""
32+
SR_ARTIFACTS_URL: ""
33+
SR_TFT_DEBUG: false
3134
prepare:
3235
- name: Use vault.centos.org repos (CS 7, 8 EOL workaround)
3336
script: |

0 commit comments

Comments
 (0)