-
Notifications
You must be signed in to change notification settings - Fork 17
107 lines (98 loc) · 3.93 KB
/
run_e2e_tests.yml
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
name: run_e2e_tests HW workflow
on:
# To be able to launch it from pull_request.yml programmatically
workflow_call:
inputs:
gh_release_name:
description: GitHub release name containing Fluent Bit packages
required: false
default: latest
type: string
infra_agent_version:
description: Infrastructure Agent version
required: true
default: latest
type: string
infra_agent_env:
description: Repository used to download infra-agent
required: false
default: staging
type: string # To be able to launch it from the Actions UI, on-demand
test_report_filename:
description: Test report to process and act upon by the actions
required: false
default: test-report-prerelease.xml
type: string # To be able to launch it from the Actions UI, on-demand
workflow_dispatch:
inputs:
gh_release_name:
description: GitHub release name containing Fluent Bit packages
required: false
default: latest
type: string
infra_agent_version:
description: Infrastructure Agent version
required: true
default: latest
type: string
infra_agent_env:
description: Repository used to download infra-agent
required: false
default: production
type: string # To be able to launch it from the Actions UI, on-demand
test_report_filename:
description: Test report to process and act upon by the actions
required: false
default: test-report-prerelease.xml
type: string # To be able to launch it from the Actions UI, on-demand
# So that only one test suite will be run simultaneously against a given GH release. This ensures that there will not
# be multiple runners accessing the same Terraform state at the same time. Note that we need to set this lock here as well
# as in the pull_request.yml since this workflow can also be run on-demand from the UI, and potentially by the infrastructure-agent
# CI/CD pipeline.
concurrency: e2e-workflow-${{ inputs.gh_release_name }}
jobs:
spin_up_test_executor_instances:
name: Spin up test executor instances
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "terraform/ec2-test-executors/${{ inputs.infra_agent_env }} PRE_RELEASE_NAME=${{ inputs.gh_release_name }}"
secrets: inherit
provision_and_execute_tests:
name: Provision instances and run tests
needs: spin_up_test_executor_instances
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "ansible/provision-and-execute-tests/${{ inputs.infra_agent_env }} PRE_RELEASE_NAME=${{ inputs.gh_release_name }} TEST_REPORT_NAME=${{ inputs.test_report_filename }}"
secrets: inherit
report_test_results:
name: Report results
runs-on: ubuntu-20.04
needs: provision_and_execute_tests
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download report from pre-release
run: |
gh release download ${{ inputs.gh_release_name }} --pattern ${{ inputs.test_report_filename }}
- name: Tests Report Details
uses: dorny/test-reporter@v1
with:
name: Tests Report Details # Name of the check run which will be created
path: ${{ inputs.test_report_filename }} # Path to test results
reporter: jest-junit
- name: Tests Report Summary
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
${{ inputs.test_report_filename }}
tear_down_test_executor_instances:
name: Tear down test executor instances
# if: always()
needs: report_test_results
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "terraform/ec2-test-executors/clean PRE_RELEASE_NAME=${{ inputs.gh_release_name }}"
secrets: inherit