Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG UE
Commits
f13a1245
Commit
f13a1245
authored
Sep 26, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get test results into dahsboard : part 1 formatting
parent
69748161
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
10 deletions
+93
-10
ci-scripts/ran_dashboard.py
ci-scripts/ran_dashboard.py
+81
-10
ci-scripts/ran_dashboard_cfg.yaml
ci-scripts/ran_dashboard_cfg.yaml
+12
-0
No files found.
ci-scripts/ran_dashboard.py
View file @
f13a1245
...
...
@@ -57,7 +57,7 @@ class gDashboard:
#worksheet
self
.
sheet
=
self
.
ss
.
worksheet
(
worksheet
)
self
.
ss
.
del_worksheet
(
self
.
sheet
)
#start by deleting the old sheet
self
.
sheet
=
self
.
ss
.
add_worksheet
(
title
=
worksheet
,
rows
=
"100"
,
cols
=
"
2
0"
)
#create a new one
self
.
sheet
=
self
.
ss
.
add_worksheet
(
title
=
worksheet
,
rows
=
"100"
,
cols
=
"
3
0"
)
#create a new one
self
.
d
=
{}
#data dictionary
...
...
@@ -78,10 +78,21 @@ class gDashboard:
row
=
[
dt_string
]
self
.
sheet
.
insert_row
(
row
,
index
=
1
,
value_input_option
=
'RAW'
)
#line 2 empty
#line 2 is for the test names (links to jenkins pipeline), updated at the end
#line 3 is for the column names
i
=
3
row
=
[
"MR"
,
"Created_at"
,
"Author"
,
"Title"
,
"Assignee"
,
"Reviewer"
,
"CAN START"
,
"IN PROGRESS"
,
"COMPLETED"
,
"Review Form"
,
"OK MERGE"
,
"Merge conflicts"
]
#test 1
row
.
append
(
"# PASS"
)
row
.
append
(
"# FAIL"
)
row
.
append
(
"Last Fail"
)
#test 2
row
.
append
(
"# PASS"
)
row
.
append
(
"# FAIL"
)
row
.
append
(
"Last Fail"
)
self
.
sheet
.
insert_row
(
row
,
index
=
i
,
value_input_option
=
'RAW'
)
#line 4 onward, MR data lines
...
...
@@ -143,16 +154,30 @@ class gDashboard:
found
=
True
n
+=
1
#add test results, notice : NSA only for the moment (code to be refactored for multiple tests afterwards)
cmd
=
"python3 /home/oaicicd/mysql/sql_connect_dev.py "
+
str
(
self
.
d
[
x
][
'iid'
])
process
=
subprocess
.
Popen
(
shlex
.
split
(
cmd
),
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readline
()
tmp
=
output
.
decode
(
"utf-8"
)
tmp
=
tmp
.
replace
(
'
\'
'
,
'"'
)
tmp
=
tmp
.
rstrip
()
testres
=
json
.
loads
(
tmp
)
#build final row to be inserted, the first column is left empty for now, will be filled afterward with hyperlinks to gitlab MR
row
=
[
""
,
str
(
date_time_obj
.
date
()),
str
(
self
.
d
[
x
][
'author'
][
'name'
]),
str
(
self
.
d
[
x
][
'title'
]),
\
assignee
,
reviewer
,
\
milestone1
,
milestone2
,
milestone3
,
review_form
,
milestone4
,
conflicts
]
milestone1
,
milestone2
,
milestone3
,
review_form
,
milestone4
,
conflicts
,
\
testres
[
'PASS'
],
testres
[
'FAIL'
]]
#insert the row to worksheet
self
.
sheet
.
insert_row
(
row
,
index
=
i
,
value_input_option
=
'RAW'
)
#add MR hyperlinks in a list of requests to be sent as one update batch; this to save API calls (quotas)
i
=
3
requests
=
[]
...
...
@@ -162,10 +187,39 @@ class gDashboard:
hyperlink
=
'
\"
'
+
"https://gitlab.eurecom.fr/oai/openairinterface5g/-/merge_requests/"
+
str
(
self
.
d
[
x
][
'iid'
])
+
'
\"
'
text
=
'
\"
'
+
str
(
self
.
d
[
x
][
'iid'
])
+
'"'
requests
.
append
(
self
.
addHyperlink
(
hyperlink
,
text
,
destinationSheetName
,
rowIndex
,
colIndex
))
cmd
=
"python3 /home/oaicicd/mysql/sql_connect_dev.py "
+
str
(
self
.
d
[
x
][
'iid'
])
process
=
subprocess
.
Popen
(
shlex
.
split
(
cmd
),
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readline
()
tmp
=
output
.
decode
(
"utf-8"
)
tmp
=
tmp
.
replace
(
'
\'
'
,
'"'
)
tmp
=
tmp
.
rstrip
()
testres
=
json
.
loads
(
tmp
)
if
len
(
testres
[
'fails list'
])
>
0
:
colIndex
=
14
hyperlink
=
'
\"
'
+
testres
[
'fails link'
][
0
]
+
'
\"
'
text
=
'
\"
'
+
testres
[
'fails list'
][
0
]
+
'"'
requests
.
append
(
self
.
addHyperlink
(
hyperlink
,
text
,
destinationSheetName
,
rowIndex
,
colIndex
))
i
=
i
+
1
body
=
{
"requests"
:
requests
}
self
.
ss
.
batch_update
(
body
)
#line 2 is for the test names
#add MR hyperlinks in a list of requests to be sent as one update batch; this to save API calls (quotas)
requests
=
[]
rowIndex
=
1
colIndex
=
12
hyperlink
=
'
\"
'
+
"https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-NSA-Mini-Module/"
+
'
\"
'
text
=
'
\"
'
+
'NSA Mini'
+
'"'
requests
.
append
(
self
.
addHyperlink
(
hyperlink
,
text
,
destinationSheetName
,
rowIndex
,
colIndex
))
rowIndex
=
1
colIndex
=
15
hyperlink
=
'
\"
'
+
"https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-Module/"
+
'
\"
'
text
=
'
\"
'
+
'NR SA'
+
'"'
requests
.
append
(
self
.
addHyperlink
(
hyperlink
,
text
,
destinationSheetName
,
rowIndex
,
colIndex
))
body
=
{
"requests"
:
requests
}
self
.
ss
.
batch_update
(
body
)
def
addHyperlink
(
self
,
hyperlink
,
text
,
destinationSheetName
,
rowIndex
,
colIndex
):
...
...
@@ -207,17 +261,17 @@ class gDashboard:
"copyPaste"
:
{
"source"
:
{
"sheetId"
:
sourceSheetId
,
"startRowIndex"
:
0
,
"startRowIndex"
:
1
,
"endRowIndex"
:
40
,
"startColumnIndex"
:
0
,
"endColumnIndex"
:
1
2
"endColumnIndex"
:
1
9
},
"destination"
:
{
"sheetId"
:
destinationSheetId
,
"startRowIndex"
:
0
,
"startRowIndex"
:
1
,
"endRowIndex"
:
40
,
"startColumnIndex"
:
0
,
"endColumnIndex"
:
1
2
"endColumnIndex"
:
1
9
},
"pasteType"
:
"PASTE_FORMAT"
}
...
...
@@ -280,11 +334,28 @@ class gDashboard:
}
)
#group MR related columns
# sheetId = self.ss.worksheet(destinationSheetName)._properties['sheetId']
# requests.append(
# {
# "addDimensionGroup": {
# "range": {
# "dimension": "COLUMNS",
# "sheetId": sheetId,
# "startIndex": 3,
# "endIndex": 12
# },
# }
# }
# )
#
body
=
{
"requests"
:
requests
}
self
.
ss
.
batch_update
(
body
)
def
main
():
my_gDashboard
=
gDashboard
(
"/opt/dashboard/g_creds.json"
,
'OAI RAN Dashboard'
,
'MR Status'
)
cmd
=
"""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """
...
...
ci-scripts/ran_dashboard_cfg.yaml
0 → 100644
View file @
f13a1245
LTE-2x2
:
#short name used in the dashboard
job
:
'
RAN-LTE-2x2-Module-OAIEPC'
#job name from Jenkins, used in the database
link
:
'
https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-LTE-2x2-Module-OAIEPC'
NSA-B200
:
job
:
'
RAN-NSA-B200-Module-LTEBOX'
link
:
'
https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-NSA-B200-Module-LTEBOX'
NSA-2x2
:
job
:
'
RAN-NSA-2x2-Module-OAIEPC'
link
:
'
https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-NSA-2x2-Module-OAIEPC'
SA-N310
:
job
:
'
RAN-SA-Module-CN5G'
link
:
'
https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-Module-CN5G'
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment