Родитель
1408ef5e56
Коммит
4fa84f9c1d
|
@ -158,7 +158,7 @@ cypress window will open locally - select test file to run the tests
|
|||
|
||||
9. `pip install jupyter`
|
||||
10. `cd notebooks\responsibleaidashboard`
|
||||
11. To execute tests run `yarn e2e-widget`. Sometimes it is preferable to watch the execution and select only individual test cases. This is possible by running the notebook manually and using `yarn e2e-widget -w --host {host} -n {notebook}` where host is where RAI widget runs on (printed in notebook output) and notebook is the name of the notebook you are running. Eg: `yarn e2e-widget -w --host 5000 -n responsibleaidashboard-census-classification-model-debugging`
|
||||
11. To execute tests run `yarn e2e-widget`. Sometimes it is preferable to watch the execution and select only individual test cases. This is possible by running the notebook manually and using `yarn e2e-widget -w --host {host} -n {notebook}` where host is where RAI widget runs on (printed in notebook output) and notebook is the name of the notebook you are running. Eg: `yarn e2e-widget -w --host 8704 -n responsibleaidashboard-census-classification-model-debugging`
|
||||
|
||||
Cypress window will open locally - select test file to run the tests.
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ export const messages = {
|
|||
|
||||
// calculateMetrics can be used with local flask server for debugging
|
||||
/*export function calculateMetrics(postData: IMetricRequest): Promise<IMetricResponse> {
|
||||
return fetch("http://localhost:5000/1/metrics", {
|
||||
return fetch("http://localhost:8704/1/metrics", {
|
||||
method: "post",
|
||||
body: JSON.stringify(postData),
|
||||
headers: {
|
||||
|
|
|
@ -12,7 +12,7 @@ Provide environment detection for enabling Flask server without configuring at i
|
|||
`flask_service = FlaskHelper(ip=<ip-to-listen-on>, port=<port-to-listen-on>)`
|
||||
|
||||
If `ip` is not specified then it listens on `localhost` by default.
|
||||
If `port` is not specified then it finds an open port in the range 5000 to 5099
|
||||
If `port` is not specified then it finds an open port in the range 8704 to 8993
|
||||
and listens on it.
|
||||
|
||||
To register a function to listen on an route:
|
||||
|
|
|
@ -39,7 +39,7 @@ class FlaskHelper(object):
|
|||
if self.port is None:
|
||||
# Try 100 different ports
|
||||
available = False
|
||||
for port in range(5000, 5100):
|
||||
for port in range(8704, 8994):
|
||||
available = FlaskHelper._is_local_port_available(
|
||||
self.ip, port, raise_error=False)
|
||||
if available:
|
||||
|
@ -47,7 +47,7 @@ class FlaskHelper(object):
|
|||
break
|
||||
|
||||
if not available:
|
||||
error_message = """Ports 5000 to 5100 not available.
|
||||
error_message = """Ports 8704 to 8993 not available.
|
||||
Please specify an open port for use via the 'port'
|
||||
parameter"""
|
||||
raise RuntimeError(
|
||||
|
|
|
@ -34,7 +34,7 @@ class TestEnvironmentDetector(object):
|
|||
return_value=False)
|
||||
with pytest.raises(RuntimeError) as exception:
|
||||
FlaskHelper(ip="not localhost", with_credentials=False)
|
||||
assert "Ports 5000 to 5100 not available." in \
|
||||
assert "Ports 8704 to 8993 not available." in \
|
||||
exception.value.args[0]
|
||||
|
||||
def test_local(self):
|
||||
|
|
|
@ -14,10 +14,10 @@ class TestFlaskHelper(object):
|
|||
|
||||
def setup_class(cls):
|
||||
"""Set up once for all tests."""
|
||||
cls.port_range_start = 5000
|
||||
cls.port_range_end = 5099
|
||||
cls.port_range_start = 8704
|
||||
cls.port_range_end = 8993
|
||||
cls.test_ip_local = "localhost"
|
||||
cls.test_port_local = 5100
|
||||
cls.test_port_local = 8994
|
||||
|
||||
def get_http_client(self):
|
||||
"""Get HTTP client with automatic retries."""
|
||||
|
@ -35,7 +35,7 @@ class TestFlaskHelper(object):
|
|||
|
||||
flask_service = FlaskHelper(ip=self.test_ip_local)
|
||||
|
||||
assert (flask_service.port >= 5000 and flask_service.port <= 5099)
|
||||
assert (flask_service.port >= 8704 and flask_service.port <= 8993)
|
||||
|
||||
@flask_service.app.route("/hello", methods=["GET"])
|
||||
def hello():
|
||||
|
|
Загрузка…
Ссылка в новой задаче