Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dryrun, write and failfast options to 'buildtest tutorial-examples' command #1720

Merged
merged 12 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ _buildtest ()
;;
tutorial-examples)
local cmds="aws spack"
local opts="--help -h"
local opts="--help -h -d --dryrun --failfast -w --write"
COMPREPLY=( $( compgen -W "${cmds}" -- "${cur}" ) )
if [[ $cur == -* ]] ; then
COMPREPLY=( $( compgen -W "${opts}" -- "${cur}" ) )
Expand Down
21 changes: 18 additions & 3 deletions buildtest/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,17 +595,32 @@ def stylecheck_menu(self):
def tutorial_menu(self):
parser = self.subparsers.choices["tutorial-examples"]

unittests_args = [
tutorial = [
(
["examples"],
{
"help": "Select which tutorial examples to build",
"choices": ["aws", "spack"],
},
)
),
(
["-d", "--dryrun"],
{
"action": "store_true",
"help": "Just print commands that will be generated without running them",
},
),
(
["-w", "--write"],
{
"action": "store_true",
"help": "Write the content of each command to file",
},
),
(["--failfast"], {"action": "store_true", "help": "Stop on first failure"}),
]

for args, kwargs in unittests_args:
for args, kwargs in tutorial:
parser.add_argument(*args, **kwargs)

def unittest_menu(self):
Expand Down
15 changes: 7 additions & 8 deletions buildtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@
from buildtest.system import BuildTestSystem
from buildtest.tools.editor import set_editor
from buildtest.tools.stylecheck import run_style_checks
from buildtest.tools.tutorialexamples import (
generate_aws_examples,
generate_tutorial_examples,
)
from buildtest.tools.tutorialexamples import generate_tutorial_examples
from buildtest.tools.unittests import run_unit_tests
from buildtest.utils.file import (
create_dir,
Expand Down Expand Up @@ -384,10 +381,12 @@ def main():
)

elif args.subcommands == "tutorial-examples":
if args.examples == "spack":
generate_tutorial_examples()
elif args.examples == "aws":
generate_aws_examples()
generate_tutorial_examples(
examples=args.examples,
dryrun=args.dryrun,
write=args.write,
failfast=args.failfast,
)

elif args.subcommands in ["stylecheck", "style"]:
run_style_checks(
Expand Down
139 changes: 0 additions & 139 deletions buildtest/tools/docs.py

This file was deleted.

Loading
Loading