forked from Ed-Fi-Alliance-OSS/AdminAPI-1.x
-
Notifications
You must be signed in to change notification settings - Fork 10
147 lines (123 loc) · 5.01 KB
/
api-e2e-pgsql-multitenant.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
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
144
145
146
147
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: Admin API Multi Tenant E2E Tests + ODS 7 + Pgsql
on:
push:
branches: [main]
schedule:
- cron: "0 5 * * 1"
workflow_dispatch:
pull_request:
branches: [main]
env:
JIRA_ACCESS_TOKEN: ${{ secrets.JIRA_ACCESS_TOKEN }}
ADMIN_API_VERSION: "1.2"
PROJECT_ID: "13401"
CYCLE_NAME: "Automation Cycle"
TASK_NAME: "API Automation Task"
FOLDER_NAME: "API Automation Run"
RESULTS_FILE: "test-xml-results"
permissions: read-all
jobs:
run-e2e-multitenant-tests:
defaults:
run:
working-directory: ./Application/EdFi.Ods.AdminApi/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Copy application folder to docker context
run: |
mkdir ../../Docker/Application
cp -r ../EdFi.Ods.AdminApi ../../Docker/Application
- name: Copy admin console folder to docker context
run: cp -r ../EdFi.Ods.AdminApi.AdminConsole ../../Docker/Application
- name: Copy nuget config to docker context
run: cp ../NuGet.Config ../../Docker/Application
- name: Update certificates
run: cp -r ../../eng/test-certs/ssl ../../Docker/Settings
- name: Run Admin API
run: |
docker compose \
-f '../../Docker/Compose/pgsql/MultiTenant/compose-build-dev-multi-tenant.yml' \
--env-file './E2E Tests/gh-action-setup/.automation_pgsql.env' \
up -d
- name: Verify containers are running
run: |
chmod +x './E2E Tests/gh-action-setup/inspect.sh'
'./E2E Tests/gh-action-setup/inspect.sh' adminapi
- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20"
- name: Install Tools
- name: Combine Collections
run: |
postman-combine-collections -f './E2E Tests/Admin API E2E 2.0 -*.postman_collection.json' \
-n 'Admin API E2E 2.0' \
-o './E2E Tests/Admin-API-Full-Collection.json'
- name: Run tests
run: |
newman run './E2E Tests/Admin-API-Full-Collection.json' \
-e './E2E Tests/Admin API Docker-multitenant-pgsql.postman_environment.json' \
-r cli,junit,htmlextra \
--reporter-htmlextra-title 'AdminAPI - 2.0' \
--reporter-htmlextra-export './report-html/results.html' \
--reporter-junit-export ./reports/report.xml \
-k
- name: Get Docker logs
if: failure()
run: |
mkdir docker-logs
docker logs ed-fi-db-admin-adminapi-tenant1 > docker-logs/ed-fi-db-admin-adminapi-tenant1.log
docker logs ed-fi-db-admin-adminapi-tenant2 > docker-logs/ed-fi-db-admin-adminapi-tenant2.log
docker logs adminapi-packaged > docker-logs/adminapi-packaged.log
- name: Upload Docker logs
if: failure()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: docker-logs
path: Application/EdFi.Ods.AdminApi/docker-logs/
retention-days: 5
- name: Upload Html results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: success() || failure()
with:
name: test-html-results
path: Application/EdFi.Ods.AdminApi/report-html/results.html
retention-days: 5
- name: Upload xml results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: success() || failure()
with:
name: test-xml-results
path: Application/EdFi.Ods.AdminApi/reports/report.xml
retention-days: 5
report:
defaults:
run:
shell: pwsh
needs:
- run-e2e-multitenant-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download artifacts
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 #v4.1.1
# Commented code until Token is renewed
# - name: Send report to Zephyr
# run: |
# $parameters = @{
# cycleName = '${{ env.CYCLE_NAME }}'
# taskName = '${{ env.TASK_NAME }}'
# folderName = '${{ env.FOLDER_NAME }}'
# }
# .\eng\send-test-results.ps1 `
# -PersonalAccessToken ${{ env.JIRA_ACCESS_TOKEN }} `
# -ProjectId ${{ env.PROJECT_ID }} `
# -AdminApiVersion '${{ env.ADMIN_API_VERSION }}' `
# -ResultsFilePath '${{ env.RESULTS_FILE }}/report.xml' `
# -ConfigParams $parameters