tests-with-logs (FORCE the logs to be avaliable when running / debugging the tests) #8

Merged
3wordchant merged 4 commits from tests-with-logs into tests 2021-08-05 23:51:44 +00:00
Collaborator
(capsul-flask-v3enmf6D) forest@thingpad:~/Desktop/git/capsul-flask$ python3 -m unittest; cat unittest-log-output.log; rm unittest-log-output.log[2021-07-27 14:48:15,429] WARNING in shared: No MAIL_SERVER configured. capsul will simply print emails to stdout.[2021-07-27 14:48:15,429] WARNING in shared: unable to create btcpay client. Capsul will work fine except cryptocurrency payments will not work. The error was: builtins.ValueError: subsection not found
[2021-07-27 14:48:15,429] INFO in shared: is_running_server: True
[2021-07-27 14:48:15,467] INFO in base: Adding job tentatively -- it will be properly scheduled when the scheduler starts
[2021-07-27 14:48:15,468] INFO in base: Added job "heartbeat-task" to job store "default"
[2021-07-27 14:48:15,468] INFO in base: Scheduler started
[2021-07-27 14:48:15,468] DEBUG in base: Looking for jobs to run
[2021-07-27 14:48:15,468] DEBUG in base: Next wakeup is due at 2021-07-27 14:48:20.467256-05:00 (in 4.998467 seconds)
[2021-07-27 14:48:15,471] INFO in shared: loading schema migration scripts from /home/forest/Desktop/git/capsul-flask/capsulflask/schema_migrations
[2021-07-27 14:48:15,476] INFO in shared: schema is already up to date.  current schemaVersion: "18"
..F...F.....
======================================================================
FAIL: test_create_fails_capacity (capsulflask.tests.test_console.ConsoleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 76, in test_create_fails_capacity
    mock_method.assert_called()
  File "/usr/lib/python3.8/unittest/mock.py", line 882, in assert_called
    raise AssertionError(msg)
AssertionError: Expected 'capacity_avaliable' to have been called.

======================================================================
FAIL: test_create_succeeds (capsulflask.tests.test_console.ConsoleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 127, in test_create_succeeds
    self.assertEqual(
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 12 tests in 0.752s

FAILED (failures=2)
ConsoleTests.test_create_fails_capacity: ERROR: console.create()!
ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_capacity: ERROR: console.create()!
ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_credit: ERROR: console.create()!
ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_credit: ERROR: console.create()!
ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_invalid: ERROR: console.create()!
ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_invalid: ERROR: console.create()!
ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_loads: ERROR: console.create()!
ConsoleTests.test_create_loads: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_succeeds: ERROR: console.create()!
ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_succeeds: ERROR: console.create()!
ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_capacity: ERROR: console.create()!
ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_capacity: ERROR: console.create()!
ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_credit: ERROR: console.create()!
ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_credit: ERROR: console.create()!
ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_invalid: ERROR: console.create()!
ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_fails_invalid: ERROR: console.create()!
ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_loads: ERROR: console.create()!
ConsoleTests.test_create_loads: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_succeeds: ERROR: console.create()!
ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com
ConsoleTests.test_create_succeeds: ERROR: console.create()!
ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com

``` (capsul-flask-v3enmf6D) forest@thingpad:~/Desktop/git/capsul-flask$ python3 -m unittest; cat unittest-log-output.log; rm unittest-log-output.log[2021-07-27 14:48:15,429] WARNING in shared: No MAIL_SERVER configured. capsul will simply print emails to stdout.[2021-07-27 14:48:15,429] WARNING in shared: unable to create btcpay client. Capsul will work fine except cryptocurrency payments will not work. The error was: builtins.ValueError: subsection not found [2021-07-27 14:48:15,429] INFO in shared: is_running_server: True [2021-07-27 14:48:15,467] INFO in base: Adding job tentatively -- it will be properly scheduled when the scheduler starts [2021-07-27 14:48:15,468] INFO in base: Added job "heartbeat-task" to job store "default" [2021-07-27 14:48:15,468] INFO in base: Scheduler started [2021-07-27 14:48:15,468] DEBUG in base: Looking for jobs to run [2021-07-27 14:48:15,468] DEBUG in base: Next wakeup is due at 2021-07-27 14:48:20.467256-05:00 (in 4.998467 seconds) [2021-07-27 14:48:15,471] INFO in shared: loading schema migration scripts from /home/forest/Desktop/git/capsul-flask/capsulflask/schema_migrations [2021-07-27 14:48:15,476] INFO in shared: schema is already up to date. current schemaVersion: "18" ..F...F..... ====================================================================== FAIL: test_create_fails_capacity (capsulflask.tests.test_console.ConsoleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 76, in test_create_fails_capacity mock_method.assert_called() File "/usr/lib/python3.8/unittest/mock.py", line 882, in assert_called raise AssertionError(msg) AssertionError: Expected 'capacity_avaliable' to have been called. ====================================================================== FAIL: test_create_succeeds (capsulflask.tests.test_console.ConsoleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 127, in test_create_succeeds self.assertEqual( AssertionError: 0 != 1 ---------------------------------------------------------------------- Ran 12 tests in 0.752s FAILED (failures=2) ConsoleTests.test_create_fails_capacity: ERROR: console.create()! ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_capacity: ERROR: console.create()! ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_credit: ERROR: console.create()! ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_credit: ERROR: console.create()! ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_invalid: ERROR: console.create()! ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_invalid: ERROR: console.create()! ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_loads: ERROR: console.create()! ConsoleTests.test_create_loads: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_succeeds: ERROR: console.create()! ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_succeeds: ERROR: console.create()! ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_capacity: ERROR: console.create()! ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_capacity: ERROR: console.create()! ConsoleTests.test_create_fails_capacity: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_credit: ERROR: console.create()! ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_credit: ERROR: console.create()! ConsoleTests.test_create_fails_credit: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_invalid: ERROR: console.create()! ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_fails_invalid: ERROR: console.create()! ConsoleTests.test_create_fails_invalid: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_loads: ERROR: console.create()! ConsoleTests.test_create_loads: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_succeeds: ERROR: console.create()! ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com ConsoleTests.test_create_succeeds: ERROR: console.create()! ConsoleTests.test_create_succeeds: WARNING: when capsul capacity is restored, send an email to test@example.com ```
forest added 3 commits 2021-07-27 19:50:29 +00:00
continuous-integration/drone/push Build is passing Details
f5640a1d01
getting unit tests to log properly
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details
6d52f56d27
documenting the janky tests logs situation
Author
Collaborator

(capsul-flask-v3enmf6D) forest@thingpad:~/Desktop/git/capsul-flask$ python3 -m unittest; cat unittest-log-output.log; rm unittest-log-output.log
[2021-07-27 15:46:44,960] WARNING in shared: No MAIL_SERVER configured. capsul will simply print emails to stdout.
[2021-07-27 15:46:44,961] WARNING in shared: unable to create btcpay client. Capsul will work fine except cryptocurrency payments will not work. The error was: builtins.ValueError: subsection not found
[2021-07-27 15:46:44,961] INFO in shared: is_running_server: True
[2021-07-27 15:46:45,000] INFO in base: Adding job tentatively -- it will be properly scheduled when the scheduler starts
[2021-07-27 15:46:45,001] INFO in base: Added job "heartbeat-task" to job store "default"
[2021-07-27 15:46:45,001] INFO in base: Scheduler started
[2021-07-27 15:46:45,001] DEBUG in base: Looking for jobs to run
[2021-07-27 15:46:45,001] DEBUG in base: Next wakeup is due at 2021-07-27 15:46:50.000596-05:00 (in 4.998649 seconds)
[2021-07-27 15:46:45,004] INFO in shared: loading schema migration scripts from /home/forest/Desktop/git/capsul-flask/capsulflask/schema_migrations
[2021-07-27 15:46:45,009] INFO in shared: schema is already up to date.  current schemaVersion: "18"
 * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:45,036] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:45,082] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:45,123] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2021-07-27 15:46:45,145] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:45,170] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:45,174] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:45,192] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /hub/claim-operation/5/baikal HTTP/1.1" 200 -
[2021-07-27 15:46:46,196] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation/5 HTTP/1.1" 200 -
F * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:46,277] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2021-07-27 15:46:46,294] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:46,313] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:46,317] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:46,355] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2021-07-27 15:46:46,374] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:46,393] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:46,397] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:46,436] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2021-07-27 15:46:46,458] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:46,513] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2021-07-27 15:46:46,531] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:46,553] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
[2021-07-27 15:46:46,556] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 -
E * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:48,629] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:48,694] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:48,757] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f83013aad90>
  _warnings.warn(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f83012eedf0>
  _warnings.warn(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f8300a5d9d0>
  _warnings.warn(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f83012a15e0>
  _warnings.warn(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:48,827] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
. * Serving Flask app "capsulflask" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
[2021-07-27 15:46:48,888] INFO in _internal:  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
.
======================================================================
ERROR: test_create_succeeds (capsulflask.tests.test_console.ConsoleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 144, in test_create_succeeds
    response = client.post(url_for("console.create"), data=data)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 1016, in post
    return self.open(*args, **kw)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/testing.py", line 222, in open
    return Client.open(
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 970, in open
    response = self.run_wsgi_app(environ.copy(), buffered=buffered)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 861, in run_wsgi_app
    rv = run_wsgi_app(self.application, environ, buffered=buffered)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 1096, in run_wsgi_app
    app_rv = app(environ, start_response)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/auth.py", line 31, in wrapped_view
    return view(**kwargs)
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/console.py", line 261, in create
    current_app.config["HUB_MODEL"].create(
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/hub_model.py", line 232, in create
    raise ValueError(f"expected create capsul operation {operation_id} to be assigned to one host, it was assigned to {number_of_assigned} ({assigned_hosts_string})")
ValueError: expected create capsul operation 6 to be assigned to one host, it was assigned to 0 ()

======================================================================
FAIL: test_create_fails_capacity (capsulflask.tests.test_console.ConsoleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 96, in test_create_fails_capacity
    self.assert200(response)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask_testing/utils.py", line 341, in assert200
    self.assertStatus(response, 200, message)
  File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask_testing/utils.py", line 329, in assertStatus
    self.assertEqual(response.status_code, status_code, message)
AssertionError: 302 != 200 : HTTP Status 200 expected but got 302

----------------------------------------------------------------------
Ran 12 tests in 3.956s

FAILED (failures=1, errors=1)
ConsoleTests.test_create_succeeds: ERROR: do_http (HTTP POST http://localhost:5000/spoke/operation/6) failed with: asyncio.exceptions.TimeoutError: 
``` (capsul-flask-v3enmf6D) forest@thingpad:~/Desktop/git/capsul-flask$ python3 -m unittest; cat unittest-log-output.log; rm unittest-log-output.log [2021-07-27 15:46:44,960] WARNING in shared: No MAIL_SERVER configured. capsul will simply print emails to stdout. [2021-07-27 15:46:44,961] WARNING in shared: unable to create btcpay client. Capsul will work fine except cryptocurrency payments will not work. The error was: builtins.ValueError: subsection not found [2021-07-27 15:46:44,961] INFO in shared: is_running_server: True [2021-07-27 15:46:45,000] INFO in base: Adding job tentatively -- it will be properly scheduled when the scheduler starts [2021-07-27 15:46:45,001] INFO in base: Added job "heartbeat-task" to job store "default" [2021-07-27 15:46:45,001] INFO in base: Scheduler started [2021-07-27 15:46:45,001] DEBUG in base: Looking for jobs to run [2021-07-27 15:46:45,001] DEBUG in base: Next wakeup is due at 2021-07-27 15:46:50.000596-05:00 (in 4.998649 seconds) [2021-07-27 15:46:45,004] INFO in shared: loading schema migration scripts from /home/forest/Desktop/git/capsul-flask/capsulflask/schema_migrations [2021-07-27 15:46:45,009] INFO in shared: schema is already up to date. current schemaVersion: "18" * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:45,036] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:45,082] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:45,123] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) [2021-07-27 15:46:45,145] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:45,170] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:45,174] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:45,192] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:45] "POST /hub/claim-operation/5/baikal HTTP/1.1" 200 - [2021-07-27 15:46:46,196] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation/5 HTTP/1.1" 200 - F * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:46,277] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) [2021-07-27 15:46:46,294] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:46,313] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:46,317] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:46,355] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) [2021-07-27 15:46:46,374] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:46,393] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:46,397] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:46,436] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) [2021-07-27 15:46:46,458] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:46,513] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) [2021-07-27 15:46:46,531] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:46,553] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - [2021-07-27 15:46:46,556] INFO in _internal: 127.0.0.1 - - [27/Jul/2021 15:46:46] "POST /spoke/operation HTTP/1.1" 200 - E * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:48,629] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:48,694] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:48,757] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) /home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f83013aad90> _warnings.warn( ResourceWarning: Enable tracemalloc to get the object allocation traceback /home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f83012eedf0> _warnings.warn( ResourceWarning: Enable tracemalloc to get the object allocation traceback /home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f8300a5d9d0> _warnings.warn( ResourceWarning: Enable tracemalloc to get the object allocation traceback /home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/aiohttp/client.py:331: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f83012a15e0> _warnings.warn( ResourceWarning: Enable tracemalloc to get the object allocation traceback . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:48,827] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) . * Serving Flask app "capsulflask" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off [2021-07-27 15:46:48,888] INFO in _internal: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) . ====================================================================== ERROR: test_create_succeeds (capsulflask.tests.test_console.ConsoleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 144, in test_create_succeeds response = client.post(url_for("console.create"), data=data) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 1016, in post return self.open(*args, **kw) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/testing.py", line 222, in open return Client.open( File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 970, in open response = self.run_wsgi_app(environ.copy(), buffered=buffered) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 861, in run_wsgi_app rv = run_wsgi_app(self.application, environ, buffered=buffered) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/werkzeug/test.py", line 1096, in run_wsgi_app app_rv = app(environ, start_response) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__ return self.wsgi_app(environ, start_response) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/forest/Desktop/git/capsul-flask/capsulflask/auth.py", line 31, in wrapped_view return view(**kwargs) File "/home/forest/Desktop/git/capsul-flask/capsulflask/console.py", line 261, in create current_app.config["HUB_MODEL"].create( File "/home/forest/Desktop/git/capsul-flask/capsulflask/hub_model.py", line 232, in create raise ValueError(f"expected create capsul operation {operation_id} to be assigned to one host, it was assigned to {number_of_assigned} ({assigned_hosts_string})") ValueError: expected create capsul operation 6 to be assigned to one host, it was assigned to 0 () ====================================================================== FAIL: test_create_fails_capacity (capsulflask.tests.test_console.ConsoleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/forest/Desktop/git/capsul-flask/capsulflask/tests/test_console.py", line 96, in test_create_fails_capacity self.assert200(response) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask_testing/utils.py", line 341, in assert200 self.assertStatus(response, 200, message) File "/home/forest/.local/share/virtualenvs/capsul-flask-v3enmf6D/lib/python3.8/site-packages/flask_testing/utils.py", line 329, in assertStatus self.assertEqual(response.status_code, status_code, message) AssertionError: 302 != 200 : HTTP Status 200 expected but got 302 ---------------------------------------------------------------------- Ran 12 tests in 3.956s FAILED (failures=1, errors=1) ConsoleTests.test_create_succeeds: ERROR: do_http (HTTP POST http://localhost:5000/spoke/operation/6) failed with: asyncio.exceptions.TimeoutError: ```
forest force-pushed tests-with-logs from 29f070b202 to c0bc65ed3d 2021-07-31 20:29:12 +00:00 Compare
Owner
............
----------------------------------------------------------------------
Ran 12 tests in 3.133s

OK

That was running in Docker. LGTM!

``` ............ ---------------------------------------------------------------------- Ran 12 tests in 3.133s OK ``` That was running in Docker. LGTM!
3wordchant merged commit e6109b7371 into tests 2021-08-05 23:51:44 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 3wordchant/capsul-flask#8
No description provided.