Skip to content

Commit

Permalink
Extra env variable to support multiple test platform
Browse files Browse the repository at this point in the history
  • Loading branch information
bitonio committed Oct 30, 2021
1 parent 1f1fe1b commit b2b4152
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ def setUpClass(cls):
cls.after = int(time.time())
cls.config_testapp_url()
cls.before = int(time.time())
else:
span = os.getenv('URL_SCAN_SPAN')
if span:
cls.after = int(time.time() - int(span))
cls.before = int(time.time())

@classmethod
def config_testapp_url(cls):
Expand All @@ -165,7 +170,9 @@ def config_testapp_url(cls):
CliEAATest.cli_print(f"Now waiting {delay}s to get the log collected")
time.sleep(delay)
else:
CliEAATest.cli_print("WARNING: no environment variable URL_TEST_TRAFFIC defined, we assume the traffic is generated separately")
CliEAATest.cli_print("WARNING: no environment variable URL_TEST_TRAFFIC defined, we assume "
"the traffic is generated separately. You may use URL_SCAN_SPAN to "
"configure how far back we need to scan in the past.")

def test_useraccess_log_raw(self):
"""
Expand Down Expand Up @@ -327,7 +334,6 @@ def test_list_directories(self):
self.assertEqual(cmd.returncode, 0, 'return code must be 0')



class TestCliEAA(CliEAATest):
"""
General commands of the CLI like version or help
Expand Down

0 comments on commit b2b4152

Please sign in to comment.