-
Notifications
You must be signed in to change notification settings - Fork 1
254 lines (199 loc) · 8.59 KB
/
tests-in-browser.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# This workflow will build and run In Browser Selenium Web Driver Tests
#
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
name: Test|In Browser|Marketplace
on:
#manually trigger deploy
workflow_dispatch:
# Trigger the workflow on push
#push:
# branches:
# - develop
# - main
#pull_request:
# branches:
# - develop
# - main
env:
# set this to the path to your solution file
SOLUTION_DIRECTORY: './'
# Solution file name
SOLUTION_FILE: 'CESMII.Marketplace.sln'
# Set this to the path to your test project file
PROJECT_DIRECTORY: './api/Tests/CESMII.Marketplace.InBrowser.Tests/'
# Test project file to use
PROJECT_NAME: 'CESMII.Marketplace.InBrowser.Tests'
# set this to the .NET core version to use
NETCORE_VERSION: "6.0.x"
# set this to the NODE JS version to use
NODEJS_VERSION: "16.17.0"
# set this to npm working directory
NPM_WORKING_DIRECTORY: 'frontend'
# Cloud Library Password
CLOUDLIB_PASSWORD: 'NotUsedAnymore'
# Access to our MongoDB
MONGODB_CONNECTION: "mongodb://localhost:27017"
jobs:
build:
runs-on: ubuntu-latest
steps:
#- name: CloudLib - Start PostgreSQL on Ubuntu
# run: |
# sudo systemctl start postgresql.service
# pg_isready
#- name: CloudLib - Create additional Postgres user
# run: |
# sudo -u postgres psql --command="CREATE USER testuser SUPERUSER PASSWORD 'password'" --command="\du"
#- name: CloudLib - Create test database with proper collation
# run: |
# sudo -u postgres psql --command="create database cloudlib_test with LC_COLLATE = 'en_US.UTF8' LC_CTYPE = 'en_US.UTF8' TEMPLATE template0"
#- name: CloudLib - List existing databases
# run: |
# sudo -u postgres psql -l --command="\du"
#- name: 🤘 CloudLib - checkout repo
# uses: actions/checkout@v2
# with:
# repository: cesmii/CESMII-CloudLibrary
# path: main
# fetch-depth: 0
#- name: ⚙ CloudLib -Install DotNet (version 6.0.x)
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '6.0.x'
#- name: CloudLib - Restore dependencies in UACloudLibraryServer
# working-directory: ./main/UACloudLibraryServer
# run: dotnet restore
#- name: CloudLib - Restore dependencies Opc.Ua.CloudLib.Client
# run: dotnet restore
# working-directory: ./main/Opc.Ua.CloudLib.Client
#- name: CloudLib - Restore dependencies SampleConsoleClient
# run: dotnet restore
# working-directory: ./main/SampleConsoleClient
#- name: CloudLib - Restore dependencies CloudLibClientTests
# run: dotnet restore
# working-directory: ./main/Tests/CloudLibClientTests
#- name: CloudLib - Restore dependencies CloudLibSync
# working-directory: ./main/CloudLibSync
# run: dotnet restore
#- name: CloudLib - Restore dependencies CloudLibSyncAzureFunction
# working-directory: ./main/CloudLibSyncAzureFunction
# run: dotnet restore
#- name: CloudLib - Build
# run: dotnet build ./main/UA-CloudLibrary.sln --configuration Release --no-restore
#- name: CloudLib - Start up UA Cloud Library Server
# env:
# ServicePassword: ${{env.CLOUDLIB_PASSWORD}}
# # Connection string for PostgreSQL from Cloud Library
# CloudLibraryPostgreSQL: 'Server=localhost;Username=testuser;Database=cloudlib_test;Port=5432;Password=password;SSLMode=Prefer;Include Error Detail=true'
# PostgreSQLEndpoint: 'localhost'
# PostgreSQLUsername: 'testuser'
# PostgreSQLPassword: 'password'
# run: |
# dotnet ./main/UACloudLibraryServer/bin/Release/net6.0/UA-CloudLibrary.dll &
# # This takes over 10 minutes to run.
#- name: CloudLib - Test
# run: dotnet test ./main/UA-CloudLibrary.sln --no-build --configuration Release --verbosity normal -l:"console;verbosity=normal"
#- name: CloudLib - List databases after test run
# run: |
# sudo -u postgres psql -l --command="\du"
- name: Marketplace API - Check out the repo
uses: actions/checkout@v2
with:
submodules: true
- name: Start MongoDB
run: docker run -d --name mongodb \
-p 27017:27017 \
-e MONGO_INIT_DATABASE=snapshot_marketplace_db_2023-07-19 \
-e MONGO_INITDB_ROOT_USERNAME=testuser \
-e MONGO_INITDB_ROOT_PASSWORD=password \
mongo6.0
- name: Create mongoDB Docker container
run: docker run -d -p 27017:27017 mongo:latest
- name: Add data to MarketplaceItem collection
run: docker -d mongorestore --collection=MarketplaceItem --db=snapshot_marketplace_db_2023-07-19 --file=test-data/MarketplaceItem.bson
- name: Add data to LookupItem
run: docker -d mongorestore --collection=LookupItem --db=snapshot_marketplace_db_2023-07-19 --file=test-data/LookupItem.bson
- name: PROCESS INQUIRY #1 ------------------------
run: |
ps ax
- name: Marketplace API - Set up dotnet core ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}
- name: PROCESS INQUIRY #2 ------------------------
run: |
ps ax
- name: Marketplace API - Restore dependencies (${{env.SOLUTION_FILE}})
run: dotnet restore ${{env.SOLUTION_FILE}}
working-directory: ${{env.SOLUTION_DIRECTORY}}
- name: PROCESS INQUIRY #3 ------------------------
run: |
ps ax
- name: Marketplace API - Build (${{env.SOLUTION_FILE}})
run: dotnet build ${{env.SOLUTION_FILE}} --configuration Release --no-restore
- name: PROCESS INQUIRY #4 ------------------------
run: |
ps ax
- name: Marketplace API - Start up Marketplace Server
env:
DBCONN: ${{ env.MONGODB_CONNECTION }}
SERVICEPASSWORD: ${{env.CLOUDLIB_PASSWORD}}
EnableCloudLibSearch: false
run: |
./api/CESMII.Marketplace.API/bin/Release/net6.0/CESMII.Marketplace.API $DBCONN $SERVICEPASSWORD &
- name: PROCESS INQUIRY #5 ------------------------
run: |
ps ax
# Call Marketplace Api sure that someone's at home.
- name: Test
run: dotnet test ./CESMII.Marketplace.RestApi/CESMII.Marketplace.RestApi.csproj
- name: PROCESS INQUIRY #6 ------------------------
run: |
ps ax
#- name: Add other libraries and all that jazz =========================================
# run: |
# sudo apt update -y
# sudo apt-get install -y gconf-service libasound2 libcairo2 libcups2 libfontconfig1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev
#- name: PROCESS INQUIRY #6 ------------------------
# run: |
# ps ax
#- name: FrontEnd - Setup chrome driver
# uses: browser-actions/setup-chrome@latest
#- name: PROCESS INQUIRY #7 ------------------------
# run: |
# ps ax
#- name: FrontEnd - Start browser and fetch version
# run: chrome --version
#- name: PROCESS INQUIRY #8 ------------------------
# run: |
# ps ax
#- name: FrontEnd - Use Node.js version (${{env.NODEJS_VERSION}})
# uses: actions/setup-node@v1
# with:
# node-version: ${{env.NODEJS_VERSION}}
#- name: PROCESS INQUIRY #9 ------------------------
# run: |
# ps ax
#- name: FrontEnd - Build React Code - npm install, build
# working-directory: ${{env.NPM_WORKING_DIRECTORY}}
# env:
# CI: '' #when process-env-ci is true, warnings are ignored and not treated as errors
# run: |
# npm install
# npm run build:in-browser-test
# npm run start-in-browser-test &
#- name: PROCESS INQUIRY #10 ------------------------
# run: |
# ps ax
##- name: Docker - launch standalone chrome browser
## run: |
## docker run -d -p 4444:4444 selenium/standalone-chrome
#- name: In-Browser Testing - Restore dependencies CESMII.Marketplace.InBrowser.Tests
# working-directory: ${{env.SOLUTION_DIRECTORY}}
# run: dotnet restore
#- name: PROCESS INQUIRY #11 ------------------------
# run: |
# ps ax
#- name: In-Browser Testing - Run Test on project (${{env.PROJECT_NAME}})
# run: dotnet test ${{env.SOLUTION_DIRECTORY}}api/Tests/CESMII.Marketplace.InBrowser.Tests/${{env.PROJECT_NAME}}.csproj --configuration Staging --verbosity normal -l:"console;verbosity=normal"
# working-directory: ${{env.SOLUTION_DIRECTORY}}