Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Lu Xu
slapos.core
Commits
cfd34e14
Commit
cfd34e14
authored
Dec 13, 2023
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup
parent
d9b958ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
slapos/testing/e2e.py
slapos/testing/e2e.py
+9
-9
No files found.
slapos/testing/e2e.py
View file @
cfd34e14
...
...
@@ -35,6 +35,8 @@ class EndToEndTestCase(unittest.TestCase):
def
createLogger
(
cls
):
LOG_FILE
=
os
.
environ
[
'SLAPOS_E2E_TEST_LOG_FILE'
]
if
not
LOG_FILE
:
raise
EnvironmentError
(
"SLAPOS_E2E_TEST_LOG_FILE environment variable not set"
)
cls
.
logger
=
logging
.
getLogger
(
'logger'
)
cls
.
logger
.
setLevel
(
logging
.
DEBUG
)
...
...
@@ -44,7 +46,7 @@ class EndToEndTestCase(unittest.TestCase):
handler
.
setFormatter
(
formatter
)
@
classmethod
def
tearDownClass
(
cls
,
final_state
=
'destroyed'
):
def
tearDownClass
(
cls
):
for
args
,
kw
in
cls
.
_requested
.
values
():
kw
[
'state'
]
=
'destroyed'
cls
.
_request
(
*
args
,
**
kw
)
...
...
@@ -128,11 +130,10 @@ class EndToEndTestCase(unittest.TestCase):
def
waitUntilPublished
(
cls
,
instance_name
,
key
,
timeout
=
80
,
t0
=
None
):
t0
=
t0
or
time
.
time
()
msg
=
'Instance %s still does not publish %s'
%
(
instance_name
,
key
)
while
(
value
:
=
cls
.
getInstanceInfos
(
instance_name
).
connection_dict
.
get
(
key
))
==
None
:
cls
.
logger
.
info
(
msg
)
cls
.
checkTimeoutAndSleep
(
t0
,
timeout
,
msg
)
while
(
value
:
=
cls
.
getInstanceInfos
(
instance_name
).
connection_dict
.
get
(
key
))
is
None
:
cls
.
logger
.
info
(
msg
)
cls
.
checkTimeoutAndSleep
(
t0
,
timeout
,
msg
)
return
value
@
classmethod
...
...
@@ -211,12 +212,11 @@ class EndToEndTestCase(unittest.TestCase):
resp
,
url
=
cls
.
waitUntilMonitorURLReady
(
instance_name
,
code
=
200
,
timeout
=
timeout
,
t0
=
t0
)
status
=
cls
.
getMonitorPromises
(
resp
.
content
)
cls
.
logger
.
info
(
"Status:"
,
status
)
cls
.
logger
.
info
(
"Status:
%s
"
,
status
)
cls
.
logger
.
info
(
"Promise Status:"
,
status
.
get
(
promise_name
,
"Promise not found"
))
"Promise Status:
%s
"
,
status
.
get
(
promise_name
,
"Promise not found"
))
if
status
.
get
(
promise_name
)
==
expected
:
cls
.
logger
.
info
(
"%s is at expected status: %s"
%
(
promise_name
,
expected
))
break
cls
.
checkTimeoutAndSleep
(
t0
,
timeout
,
msg
)
resp
=
requests
.
get
(
url
)
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