paul-tqh-nguyen / swing_dance_scores

A web interface to an implementation of a relative placement scoring system commonly used in Swing Dance competitions
0 stars 0 forks source link

Address the failures of testAllWebServicesWrtAuthenticationViaLocalFireStoreEmulator and testAllWebServicesEndToEndViaDeployedApp #36

Closed paul-tqh-nguyen closed 4 years ago

paul-tqh-nguyen commented 4 years ago

These tests fail in the latest test runs:

The failure notes are shown below:


pnguyen@pnguyenmachine:~/code/swing_dance_scores$ yes | head -n 2 | ./swing_dance_scores.py -run-tests

Port 5001 is in use by the process node with PID 29859 owned by the user pnguyen. 
We need that port to start tests. 
Should we kill it [yes/no]? We will now kill process 29859.
Terminated

Port 9090 is in use by the process java with PID 29879 owned by the user pnguyen. 
We need that port to start tests. 
Should we kill it [yes/no]? We will now kill process 29879.

Running our test suite.

testSignUpWebserviceViaLocalFirestoreEmulator (test.test_sign_up_webservice_via_local_firestore_emulator.testSignUpWebserviceViaLocalFirestoreEmulator) ... ok
testAllWebServicesEndToEndViaLocalFireStoreEmulator (test.test_all_webservices_end_to_end_via_local_firestore_emulator.testAllWebServicesEndToEndViaLocalFireStoreEmulator) ... FAIL
testAllWebServicesWrtAuthenticationViaLocalFireStoreEmulator (test.test_all_webservices_wrt_authentication_via_local_firestore_emulator.testAllWebServicesWrtAuthenticationViaLocalFireStoreEmulator) ... 
Error: Could not start functions emulator, port taken.
FAIL
testAllWebServicesEndToEndViaDeployedApp (test.test_all_webservices_end_to_end_via_deployed_app.testAllWebServicesEndToEndViaDeployedApp) ... ERROR
testDBHasFewTestUserAccounts (test.test_db_has_few_test_user_accounts.testDBHasFewTestUserAccounts) ... ok

======================================================================
ERROR: testAllWebServicesEndToEndViaDeployedApp (test.test_all_webservices_end_to_end_via_deployed_app.testAllWebServicesEndToEndViaDeployedApp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pnguyen/code/swing_dance_scores/test/test_all_webservices_end_to_end_via_deployed_app.py", line 46, in testAllWebServicesEndToEndViaDeployedApp
    signup_uri = urllib.parse.urljoin(api_base_uri_string, "signup")
NameError: name 'urllib' is not defined

======================================================================
FAIL: testAllWebServicesEndToEndViaLocalFireStoreEmulator (test.test_all_webservices_end_to_end_via_local_firestore_emulator.testAllWebServicesEndToEndViaLocalFireStoreEmulator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pnguyen/code/swing_dance_scores/test/test_all_webservices_end_to_end_via_local_firestore_emulator.py", line 61, in testAllWebServicesEndToEndViaLocalFireStoreEmulator
    self.assertEqual(200, all_competitions_response_status_code, msg="Failed to hit the endpoint at {uri} as we got the status code of {status_code}".format(uri=get_all_competitions_uri, status_code=all_competitions_response_status_code))
AssertionError: 200 != 404 : Failed to hit the endpoint at http://localhost:5001/swing-dance-scores/us-central1/api/competitions as we got the status code of 404

======================================================================
FAIL: testAllWebServicesWrtAuthenticationViaLocalFireStoreEmulator (test.test_all_webservices_wrt_authentication_via_local_firestore_emulator.testAllWebServicesWrtAuthenticationViaLocalFireStoreEmulator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pnguyen/code/swing_dance_scores/test/test_all_webservices_wrt_authentication_via_local_firestore_emulator.py", line 52, in testAllWebServicesWrtAuthenticationViaLocalFireStoreEmulator
    self.assertTrue(firestore_emulation_initialization_has_completed, msg="Could not start firebase emulator. The output was: \n\n{output}\n\nCheck if there are any java processes around hogging the desired port (lsof can be useful here).".format(output=firestore_emulation_process_text_output_total_text))
AssertionError: False is not true : Could not start firebase emulator. The output was: 

i  Starting emulators: ["functions","firestore"]
i  Shutting down emulators.
⚠  Port 5001 is not open, could not start functions emulator.
i  To select a different port for the emulator, update your "firebase.json":
    {
      // ...
      "emulators": {
        "functions": {
          "port": "PORT"
        }
      }
    }
i  Shutting down emulators.

Check if there are any java processes around hogging the desired port (lsof can be useful here).

----------------------------------------------------------------------
Ran 5 tests in 50.788s

FAILED (failures=2, errors=1)

Test run complete.

pnguyen@pnguyenmachine:~/code/swing_dance_scores$ 
paul-tqh-nguyen commented 4 years ago

The recent patches referencing this ticket (and a few misc. others) make the tests pass sufficiently. Closing for now.