Skip to content

Commit 98f77c4

Browse files
committed
record Testing Farm usage via ATEX using TF 'tags'
Signed-off-by: Jiri Jaburek <comps@nomail.dom>
1 parent 52836f3 commit 98f77c4

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/atex-test.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ jobs:
149149
env:
150150
TESTING_FARM_API_TOKEN: ${{ secrets.TESTING_FARM_API_TOKEN }}
151151
CS_MAJOR: ${{ matrix.centos_stream_major }}
152+
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
153+
ACTOR: ${{ github.actor }}
152154
run: |
153155
python3 tests/run_tests_testingfarm.py \
154156
--contest-dir contest \
@@ -157,7 +159,9 @@ jobs:
157159
--compose "CentOS-Stream-${CS_MAJOR}" \
158160
--arch x86_64 \
159161
--os-major-version "${CS_MAJOR}" \
160-
--timeout ${{ env.TEST_TIMEOUT }}
162+
--timeout ${{ env.TEST_TIMEOUT }} \
163+
--tag github_actor=$ACTOR \
164+
--tag github_repo=$REPO_URL
161165
162166
- name: Upload test results
163167
if: always()

tests/run_tests_testingfarm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
logger = logging.getLogger("ATEX")
2121

2222

23+
def kv_pair(keyval):
24+
if "=" not in keyval:
25+
raise argparse.ArgumentTypeError(f"expected KEY=VALUE, got: {keyval}")
26+
return keyval.split("=", 1)
27+
2328
def parse_args():
2429
"""Parse command-line arguments."""
2530
parser = argparse.ArgumentParser(description="Run tests on Testing Farm using atex")
@@ -33,6 +38,7 @@ def parse_args():
3338
parser.add_argument("--timeout", type=int, default=120, help="Timeout in minutes")
3439
parser.add_argument("--max-remotes", type=int, default=10, help="Maximum number of parallel test executions")
3540
parser.add_argument("--reruns", type=int, default=1, help="Number of test reruns on failure")
41+
parser.add_argument("--tag", type=kv_pair, default=[], action="append", help="Additional tag(s) to store in TF Request")
3642
return parser.parse_args()
3743

3844

@@ -116,6 +122,7 @@ def main():
116122
arch=args.arch,
117123
max_retries=2,
118124
timeout=args.timeout,
125+
tags=dict(args.tag),
119126
)
120127

121128
# Setup Contest orchestrator

0 commit comments

Comments
 (0)