Skip to content

Commit

Permalink
Merge pull request #428 from JrGoodle/type-hints
Browse files Browse the repository at this point in the history
Add type hints
  • Loading branch information
JrGoodle committed Apr 22, 2020
2 parents a90358d + afd21f6 commit ad4840b
Show file tree
Hide file tree
Showing 58 changed files with 705 additions and 652 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -31,6 +31,7 @@ addons:
packages:
- python3
- github-release
update: true

install: script/travis/install

Expand Down
34 changes: 17 additions & 17 deletions clowder_test/clowder_test/cli/base_controller.py
Expand Up @@ -38,7 +38,7 @@ class Meta:
@expose(
help='Run all tests'
)
def all(self):
def all(self) -> None:
"""clowder test all command"""

scripts = [
Expand All @@ -60,7 +60,7 @@ def all(self):
@expose(
help='Run offline tests'
)
def offline(self):
def offline(self) -> None:
"""clowder offline tests"""

execute_test_command('./offline.sh', os.path.join(self.path, 'cats'),
Expand All @@ -73,7 +73,7 @@ def offline(self):
@expose(
help='Run parallel tests'
)
def parallel(self):
def parallel(self) -> None:
"""clowder parallel tests"""

execute_test_command('./test_parallel.sh', self.path,
Expand All @@ -83,24 +83,24 @@ def parallel(self):
debug=self.app.debug,
quiet=self.app.pargs.silent)

@expose(
help='Run unit tests'
)
def unittests(self):
"""clowder unit tests"""

execute_test_command('./unittests.sh', self.path,
parallel=self.app.pargs.parallel,
write=self.app.pargs.write,
coverage=self.app.pargs.coverage,
test_env=test_env,
debug=self.app.debug,
quiet=self.app.pargs.silent)
# @expose(
# help='Run unit tests'
# )
# def unittests(self) -> None:
# """clowder unit tests"""
#
# execute_test_command('./unittests.sh', self.path,
# parallel=self.app.pargs.parallel,
# write=self.app.pargs.write,
# coverage=self.app.pargs.coverage,
# test_env=test_env,
# debug=self.app.debug,
# quiet=self.app.pargs.silent)

@expose(
help='Run tests requiring remote write permissions'
)
def write(self):
def write(self) -> None:
"""clowder write tests"""

cats_scripts = ['./write_herd.sh', './write_prune.sh', './write_repo.sh', './write_start.sh']
Expand Down
56 changes: 30 additions & 26 deletions clowder_test/clowder_test/cli/cats_controller.py
Expand Up @@ -30,197 +30,201 @@ class Meta:
@expose(
help='Run all cats tests'
)
def all(self):
def all(self) -> None:
"""clowder cats tests"""

self._execute_command('./test_example_cats.sh', os.path.join(ROOT_DIR, 'test', 'scripts'))

@expose(
help='Run cats branch tests'
)
def branch(self):
def branch(self) -> None:
"""clowder cats branch tests"""

self._execute_command('./branch.sh', self.path)

@expose(
help='Run cats checkout tests'
)
def checkout(self):
def checkout(self) -> None:
"""clowder cats checkout tests"""

self._execute_command('./checkout.sh', self.path)

@expose(
help='Run cats clean tests'
)
def clean(self):
def clean(self) -> None:
"""clowder cats clean tests"""

self._execute_command('./clean.sh', self.path)

@expose(
help='Run cats diff tests'
)
def diff(self):
def diff(self) -> None:
"""clowder cats diff tests"""

self._execute_command('./diff.sh', self.path)

@expose(
help='Run cats forall tests'
)
def forall(self):
def forall(self) -> None:
"""clowder cats forall tests"""

self._execute_command('./forall.sh', self.path)

@expose(
help='Run cats help tests'
)
def help(self):
def help(self) -> None:
"""clowder cats help tests"""

self._execute_command('./help.sh', self.path)

@expose(
help='Run cats herd branch tests'
)
def herd_branch(self):
def herd_branch(self) -> None:
"""clowder cats herd branch tests"""

self._execute_command('./herd_branch.sh', self.path)

@expose(
help='Run cats herd submodules tests'
)
def herd_submodules(self):
def herd_submodules(self) -> None:
"""clowder cats herd submodules tests"""

self._execute_command('./herd_submodules.sh', self.path)

@expose(
help='Run cats herd tag tests'
)
def herd_tag(self):
def herd_tag(self) -> None:
"""clowder cats herd tag tests"""

self._execute_command('./herd_tag.sh', self.path)

@expose(
help='Run cats herd tests'
)
def herd(self):
def herd(self) -> None:
"""clowder cats herd tests"""

self._execute_command('./herd.sh', self.path)

@expose(
help='Run cats init tests'
)
def init(self):
def init(self) -> None:
"""clowder cats init tests"""

self._execute_command('./init.sh', self.path)

@expose(
help='Run cats link tests'
)
def link(self):
def link(self) -> None:
"""clowder cats link tests"""

self._execute_command('./link.sh', self.path)

@expose(
help='Run cats prune tests'
)
def prune(self):
def prune(self) -> None:
"""clowder cats prune tests"""

self._execute_command('./prune.sh', self.path)

@expose(
help='Run cats repo tests'
)
def repo(self):
def repo(self) -> None:
"""clowder cats repo tests"""

self._execute_command('./repo.sh', self.path)

@expose(
help='Run cats reset tests'
)
def reset(self):
def reset(self) -> None:
"""clowder cats reset tests"""

self._execute_command('./reset.sh', self.path)

@expose(
help='Run cats save tests'
)
def save(self):
def save(self) -> None:
"""clowder cats save tests"""

self._execute_command('./save.sh', self.path)

@expose(
help='Run cats skip tests'
)
def skip(self):
def skip(self) -> None:
"""clowder cats skip tests"""

self._execute_command('./skip.sh', self.path)

@expose(
help='Run cats start tests'
)
def start(self):
def start(self) -> None:
"""clowder cats start tests"""

self._execute_command('./start.sh', self.path)

@expose(
help='Run cats stash tests'
)
def stash(self):
def stash(self) -> None:
"""clowder cats stash tests"""

self._execute_command('./stash.sh', self.path)

@expose(
help='Run cats status tests'
)
def status(self):
def status(self) -> None:
"""clowder cats status tests"""

self._execute_command('./status.sh', self.path)

@expose(
help='Run cats yaml tests'
)
def yaml(self):
def yaml(self) -> None:
"""clowder cats yaml tests"""

self._execute_command('./yaml.sh', self.path)

@expose(
help='Run cats yaml import tests'
)
def yaml_import(self):
def yaml_import(self) -> None:
"""clowder cats yaml import tests"""

self._execute_command('./yaml_import.sh', self.path)

@expose(
help='Run cats yaml validation tests'
)
def yaml_validation(self):
def yaml_validation(self) -> None:
"""clowder cats yaml validation tests"""

self._execute_command('./yaml_validation.sh', self.path)

def _execute_command(self, command, path):
"""Private execute command"""
def _execute_command(self, command: str, path: str) -> None:
"""Private execute command
:param str command: Command to run
:param str path: Path to set as ``cwd``
"""

execute_test_command(command, path,
parallel=self.app.pargs.parallel,
Expand Down
14 changes: 9 additions & 5 deletions clowder_test/clowder_test/cli/llvm_controller.py
Expand Up @@ -30,29 +30,33 @@ class Meta:
@expose(
help='Run all llvm tests'
)
def all(self):
def all(self) -> None:
"""clowder llvm tests"""

self._execute_command('./test_example_llvm.sh', os.path.join(ROOT_DIR, 'test', 'scripts'))

@expose(
help='Run llvm forks tests'
)
def forks(self):
def forks(self) -> None:
"""clowder llvm forks tests"""

self._execute_command('./forks.sh', self.path)

@expose(
help='Run llvm sync tests'
)
def sync(self):
def sync(self) -> None:
"""clowder llvm sync tests"""

self._execute_command('./sync.sh', self.path)

def _execute_command(self, command, path):
"""Private execute command"""
def _execute_command(self, command: str, path: str) -> None:
"""Private execute command
:param str command: Command to run
:param str path: Path to set as ``cwd``
"""

execute_test_command(command, path,
parallel=self.app.pargs.parallel,
Expand Down
16 changes: 10 additions & 6 deletions clowder_test/clowder_test/cli/swift_controller.py
Expand Up @@ -30,37 +30,41 @@ class Meta:
@expose(
help='Run all swift tests'
)
def all(self):
def all(self) -> None:
"""clowder swift tests"""

self._execute_command('./test_example_swift.sh', os.path.join(ROOT_DIR, 'test', 'scripts'))

@expose(
help='Run swift config versions tests'
)
def config_versions(self):
def config_versions(self) -> None:
"""clowder swift config versions tests"""

self._execute_command('./config_versions.sh', self.path)

@expose(
help='Run swift configure remotes tests'
)
def configure_remotes(self):
def configure_remotes(self) -> None:
"""clowder swift configure remotes tests"""

self._execute_command('./configure_remotes.sh', self.path)

@expose(
help='Run swift reset tests'
)
def reset(self):
def reset(self) -> None:
"""clowder swift reset tests"""

self._execute_command('./reset.sh', self.path)

def _execute_command(self, command, path):
"""Private execute command"""
def _execute_command(self, command: str, path: str) -> None:
"""Private execute command
:param str command: Command to run
:param str path: Path to set as ``cwd``
"""

execute_test_command(command, path,
parallel=self.app.pargs.parallel,
Expand Down

0 comments on commit ad4840b

Please sign in to comment.