nsacyber / WALKOFF

A flexible, easy to use, automation framework allowing users to integrate their capabilities and devices to cut through the repetitive, tedious tasks slowing them down. #nsacyber
https://nsacyber.github.io/WALKOFF/
Other
1.2k stars 222 forks source link

Unittests are not isolated from development and other environments. #128

Open shadowbq opened 7 years ago

shadowbq commented 7 years ago

There are multiple collisions in the db_path, case_db_path, walkoff.config location when running the test suite on system that has also run the startServer.py.

The application should have at least three distinct environments – production, development, test, and often staging; and quite often the application will behave differently in each environment.

If you run startServer, and create any content such as triggers, workbooks etc the test counts will likely fail.

Test that measure the counts in the database fail such as:

test_add_and_display_and_remove_trigger (tests.test_triggers.TestTriggers) ... FAIL

======================================================================
FAIL: test_add_and_display_and_remove_trigger (tests.test_triggers.TestTriggers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/WALKOFF/tests/test_triggers.py", line 48, in test_add_and_display_and_remove_trigger
    self.assertEqual(len(triggers), 1)
AssertionError: 2 != 1
shadowbq commented 7 years ago

PR #125.

iadgovuser11 commented 7 years ago

Thanks! I know we were working on getting that straightened out. Give us a few days didn't want to leave the pull request hanging with no response.