-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (101 loc) · 3.32 KB
/
Copy pathtests.yml
File metadata and controls
120 lines (101 loc) · 3.32 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
name: Tests (manual)
on:
workflow_dispatch:
inputs:
suite:
description: "Qué grupo de tests quieres ejecutar"
required: true
default: "controller"
type: choice
options:
- repository
- controller
- service
- security
- selenium
- api
- coverage
- all
test:
description: "Test específico opcional. Ejemplo: ProductRestControllerTest"
required: false
default: ""
concurrency:
group: tests-manual-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Tests seleccionados
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java 25 + cache Maven
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: maven
- name: Ver versiones
run: |
java -version
mvn -version
- name: Ver versión de Chrome
if: ${{ inputs.suite == 'selenium' || inputs.suite == 'all' }}
run: google-chrome --version
- name: Ejecutar test específico
if: ${{ inputs.test != '' }}
run: mvn -B test -Dtest="${{ inputs.test }}"
- name: Ejecutar Repository Tests
if: ${{ inputs.suite == 'repository' && inputs.test == '' }}
run: mvn -B test -Dtest='*RepositoryTest'
- name: Ejecutar Controller Tests
if: ${{ inputs.suite == 'controller' && inputs.test == '' }}
run: mvn -B test -Dtest='*ControllerTest'
- name: Ejecutar Service Tests
if: ${{ inputs.suite == 'service' && inputs.test == '' }}
run: mvn -B test -Dtest='*ServiceTest'
- name: Ejecutar Security Tests
if: ${{ inputs.suite == 'security' && inputs.test == '' }}
run: mvn -B test -Dtest='*SecurityTest'
- name: Ejecutar API Tests
if: ${{ inputs.suite == 'api' && inputs.test == '' }}
run: mvn -B test -Dtest='*ApiControllerTest,*RestControllerTest,*ExceptionAdviceTest'
- name: Ejecutar Selenium Tests
if: ${{ inputs.suite == 'selenium' && inputs.test == '' }}
run: mvn -B test -Dtest='*SeleniumTest'
- name: Ejecutar Coverage
if: ${{ inputs.suite == 'coverage' && inputs.test == '' }}
run: mvn -B clean verify
- name: Ejecutar todos los tests
if: ${{ inputs.suite == 'all' && inputs.test == '' }}
run: mvn -B clean test
- name: Subir reportes Surefire/Failsafe
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
**/target/surefire-reports/
**/target/failsafe-reports/
retention-days: 7
if-no-files-found: ignore
- name: Subir reporte JaCoCo
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: |
**/target/site/jacoco/
retention-days: 7
if-no-files-found: ignore
- name: Subir capturas de Selenium
if: failure()
uses: actions/upload-artifact@v4
with:
name: selenium-screenshots
path: |
**/target/screenshots/
retention-days: 7
if-no-files-found: ignore