-
Notifications
You must be signed in to change notification settings - Fork 82
143 lines (128 loc) · 5.45 KB
/
Copy pathe2e-main-tf.yaml
File metadata and controls
143 lines (128 loc) · 5.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Copyright (C) 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: PD AI Lab E2E Nightly Testing Farm
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
podman_version:
default: 'latest'
description: 'Podman version to install (e.g., "5.5.2", "5.6.0~rc1"). Use "latest" for stable or "nightly" for the latest development build.'
type: string
required: true
npm_target:
description: npm tests target
type: choice
default: 'e2e'
options:
- e2e
- smoke
- instructlab
plan:
description: plans to run
type: choice
default: 'default'
options:
- default
- gpu
jobs:
pd-ai-lab-e2e-testing-farm:
name: pd-e2e-testing-farm-ci
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
fedora-version: ['Fedora-42', 'Fedora-43']
plan: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.plan != '' && fromJSON(format('["{0}"]', github.event.inputs.plan)) || fromJSON('["default", "gpu"]') }}
steps:
- name: Set the default env. variables
env:
DEFAULT_NPM_TARGET: 'smoke'
DEFAULT_PODMAN_VERSION: 'latest'
DEFAULT_NODE_VERSION: 'v24.11.1'
run: |
echo "NPM_TARGET=${{ github.event.inputs.npm_target || env.DEFAULT_NPM_TARGET }}" >> $GITHUB_ENV
echo "PLAN=${{ matrix.plan }}" >> $GITHUB_ENV
echo "PODMAN_VERSION=${{ github.event.inputs.podman_version || env.DEFAULT_PODMAN_VERSION }}" >> $GITHUB_ENV
echo "NODE_VERSION=${{ vars.NODE_VERSION || env.DEFAULT_NODE_VERSION }}" >> $GITHUB_ENV
- name: Run Podman Desktop Playwright E2E tests on Testing Farm CI
id: run-e2e-tf
uses: sclorg/testing-farm-as-github-action@b23f0de29ac969d12411215a983da264b4ced149 #v4.2.0
with:
api_key: ${{ secrets.TF_TOKEN }}
create_github_summary: "false"
compose: ${{ matrix.fedora-version }}
tmt_plan_filter: 'name:/tests/tmt/plans/ai-lab-e2e-plan-${{ env.PLAN }}/${{ env.NPM_TARGET }}'
variables: COMPOSE=${{ matrix.fedora-version }};ARCH=x86_64;PODMAN_VERSION=${{ env.PODMAN_VERSION }};NODE_VERSION=${{ env.NODE_VERSION }}
- name: Extract Testing Farm work ID and base URL
if: always()
run: |
TF_ARTIFACTS_URL="${{ steps.run-e2e-tf.outputs.test_log_url }}"
TF_DEFAULT_JUNIT_DEFAULT="${TF_ARTIFACTS_URL}/results-junit.xml"
curl -o results-junit.xml "$TF_DEFAULT_JUNIT_DEFAULT"
TF_WORK_ID=$(grep -o 'work-${{ env.NPM_TARGET }}[^/"]*' results-junit.xml | head -1)
echo "TF_WORK_ID=$TF_WORK_ID" >> $GITHUB_ENV
echo "TF_ARTIFACTS_URL=$TF_ARTIFACTS_URL" >> $GITHUB_ENV
- name: Download Playwright JUnit report from Testing Farm
if: always()
run: |
TF_PLAYWRIGHT_JUNIT_URL="${{ env.TF_ARTIFACTS_URL }}/${{ env.TF_WORK_ID }}/tests/tmt/plans/ai-lab-e2e-plan-${{ env.PLAN }}/${{ env.NPM_TARGET }}/execute/data/guest/default-0/tests/tmt/tests/${{ env.NPM_TARGET }}-test-1/data/junit-results.xml"
curl -o junit-playwright-results.xml "$TF_PLAYWRIGHT_JUNIT_URL"
- name: Publish test report to PR
if: always()
uses: mikepenz/action-junit-report@5b7ee5a21e8674b695313d769f3cbdfd5d4d53a4 #v6.0.0
with:
fail_on_failure: true
include_passed: true
detailed_summary: true
annotate_only: true
require_tests: true
report_paths: '**/junit-playwright-results.xml'
- name: Download test artifacts from Testing Farm
if: failure()
run: |
mkdir -p results
TF_TEST_DATA_URL="${{ env.TF_ARTIFACTS_URL }}/${{ env.TF_WORK_ID }}/tests/tmt/plans/ai-lab-e2e-plan-${{ env.PLAN }}/${{ env.NPM_TARGET }}/execute/data/guest/default-0/tests/tmt/tests/${{ env.NPM_TARGET }}-test-1/data"
TF_TRACES_URL="${TF_TEST_DATA_URL}/traces/"
TF_VIDEOS_URL="${TF_TEST_DATA_URL}/videos/"
echo "Downloading traces"
wget \
--recursive \
--no-parent \
--no-host-directories \
--cut-dirs=10 \
--reject "index.html*" \
--directory-prefix=results \
"$TF_TRACES_URL"
echo "Downloading videos"
wget \
--recursive \
--no-parent \
--no-host-directories \
--cut-dirs=10 \
--reject "index.html*" \
--directory-prefix=results \
"$TF_VIDEOS_URL"
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ai-lab-testing-farm-artifacts-${{ matrix.fedora-version }}-${{ env.PLAN }}
path: |
results/*
**/junit-playwright-results.xml