in dynalab_cli/test.py [0:0]
def run_command(self):
# Validate config file: all keys exist, required values specified,
# all specified files exist, handler files in the same directory as handler,
# and handler file inherits from the correct base handler
try:
self.config_handler.validate_config()
print("Config file validated.")
except AssertionError as err:
print(
f"Error: {err}.\nPlease fix your config file by",
"dynalab-cli init --amend",
)
exit(1)
config = self.config_handler.load_config()
# Check file size and ask to exclude large files
total_size = 0
for dentry in os.scandir("."):
total_size += dentry.stat().st_size
if config["exclude"]:
for f in config["exclude"]:
total_size -= os.path.getsize(f)
if total_size > MAX_SIZE:
print(
"Warning: Size of current project folder is more than 2GB. "
"Please consider add large files or folders to exclude"
)
if self.args.local:
self.run_local_test(config)
else:
self.run_docker_test(config)