forked from mirrors/thatmattlove-hyperglass
moved starting flask to bash script
This commit is contained in:
parent
f31886b0ba
commit
ad061c886b
3 changed files with 14 additions and 28 deletions
|
|
@ -12,7 +12,7 @@ install:
|
|||
after_install:
|
||||
- bash ./ci/check_code.sh
|
||||
before_script:
|
||||
- nohup python3 ./ci/ci_test_prepare.py &
|
||||
- bash ./ci/ci_prepare.sh
|
||||
script:
|
||||
- python3 ./ci/ci_test.py
|
||||
after_script:
|
||||
|
|
|
|||
|
|
@ -11,33 +11,6 @@ working_directory = os.path.dirname(os.path.abspath(__file__))
|
|||
parent_directory = os.path.dirname(working_directory)
|
||||
|
||||
|
||||
def ci_config():
|
||||
"""Copies test configuration files to usable config files"""
|
||||
logger.info("Migrating test config files...")
|
||||
config_dir = os.path.join(parent_directory, "hyperglass/configuration/")
|
||||
test_files = glob.iglob(os.path.join(working_directory, "*.toml"))
|
||||
config_files = glob.iglob(os.path.join(config_dir, "*.toml"))
|
||||
logger.debug(config_dir)
|
||||
logger.debug(working_directory)
|
||||
logger.debug(parent_directory)
|
||||
status = False
|
||||
for f in config_files:
|
||||
if os.path.exists(f):
|
||||
logger.debug(f"{f} already exists")
|
||||
os.remove(f)
|
||||
logger.debug(f"Deleted {f}")
|
||||
for f in test_files:
|
||||
try:
|
||||
shutil.copy(f, config_dir)
|
||||
logger.debug(f"Copied {f}")
|
||||
logger.info("Successfully migrated test config files")
|
||||
status = True
|
||||
except:
|
||||
logger.error(f"Failed to migrate {f}")
|
||||
raise
|
||||
return status
|
||||
|
||||
|
||||
def construct_test(test_query, location, test_target):
|
||||
"""Constructs JSON POST data for test_hyperglass function"""
|
||||
constructed_query = json.dumps(
|
||||
13
ci/ci_prepare.sh
Normal file
13
ci/ci_prepare.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
copy_config() {
|
||||
rm ../hyperglass/configuration/*.toml
|
||||
cp *.toml ../hyperglass/configuration/
|
||||
}
|
||||
|
||||
start_flask() {
|
||||
nohup python3 ./ci_dev_server.py &
|
||||
}
|
||||
|
||||
copy_config()
|
||||
start_flask()
|
||||
Loading…
Add table
Reference in a new issue