Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
0a446240
Commit
0a446240
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Pre-release CI/CD pipeline fixes
parent
051bd585
No related branches found
No related tags found
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!137
Pre-release CI/CD fixes - Service - PathComp
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/tests/PrepareTestScenario.py
+12
-10
12 additions, 10 deletions
src/service/tests/PrepareTestScenario.py
with
12 additions
and
10 deletions
src/service/tests/PrepareTestScenario.py
+
12
−
10
View file @
0a446240
...
@@ -22,7 +22,7 @@ from service.client.ServiceClient import ServiceClient
...
@@ -22,7 +22,7 @@ from service.client.ServiceClient import ServiceClient
from
service.service.ServiceService
import
ServiceService
from
service.service.ServiceService
import
ServiceService
from
service.service.service_handler_api.ServiceHandlerFactory
import
ServiceHandlerFactory
from
service.service.service_handler_api.ServiceHandlerFactory
import
ServiceHandlerFactory
from
service.service.service_handlers
import
SERVICE_HANDLERS
from
service.service.service_handlers
import
SERVICE_HANDLERS
from
service.tests.MockService_Dependencies
import
MockService_Dependencies
#
from service.tests.MockService_Dependencies import MockService_Dependencies
LOCAL_HOST
=
'
127.0.0.1
'
LOCAL_HOST
=
'
127.0.0.1
'
MOCKSERVICE_PORT
=
10000
MOCKSERVICE_PORT
=
10000
...
@@ -30,22 +30,24 @@ SERVICE_SERVICE_PORT = MOCKSERVICE_PORT + int(get_service_port_grpc(ServiceNameE
...
@@ -30,22 +30,24 @@ SERVICE_SERVICE_PORT = MOCKSERVICE_PORT + int(get_service_port_grpc(ServiceNameE
os
.
environ
[
get_env_var_name
(
ServiceNameEnum
.
SERVICE
,
ENVVAR_SUFIX_SERVICE_HOST
)]
=
str
(
LOCAL_HOST
)
os
.
environ
[
get_env_var_name
(
ServiceNameEnum
.
SERVICE
,
ENVVAR_SUFIX_SERVICE_HOST
)]
=
str
(
LOCAL_HOST
)
os
.
environ
[
get_env_var_name
(
ServiceNameEnum
.
SERVICE
,
ENVVAR_SUFIX_SERVICE_PORT_GRPC
)]
=
str
(
SERVICE_SERVICE_PORT
)
os
.
environ
[
get_env_var_name
(
ServiceNameEnum
.
SERVICE
,
ENVVAR_SUFIX_SERVICE_PORT_GRPC
)]
=
str
(
SERVICE_SERVICE_PORT
)
@pytest.fixture
(
scope
=
'
session
'
)
#
@pytest.fixture(scope='session')
def
mock_service
():
#
def mock_service():
_service
=
MockService_Dependencies
(
MOCKSERVICE_PORT
)
#
_service = MockService_Dependencies(MOCKSERVICE_PORT)
_service
.
configure_env_vars
()
#
_service.configure_env_vars()
_service
.
start
()
#
_service.start()
yield
_service
#
yield _service
_service
.
stop
()
#
_service.stop()
@pytest.fixture
(
scope
=
'
session
'
)
@pytest.fixture
(
scope
=
'
session
'
)
def
context_client
(
mock_service
:
MockService_Dependencies
):
# pylint: disable=redefined-outer-name
#def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name
def
context_client
():
_client
=
ContextClient
()
_client
=
ContextClient
()
yield
_client
yield
_client
_client
.
close
()
_client
.
close
()
@pytest.fixture
(
scope
=
'
session
'
)
@pytest.fixture
(
scope
=
'
session
'
)
def
device_client
(
mock_service
:
MockService_Dependencies
):
# pylint: disable=redefined-outer-name
#def device_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name
def
device_client
():
_client
=
DeviceClient
()
_client
=
DeviceClient
()
yield
_client
yield
_client
_client
.
close
()
_client
.
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment