buildtesters / buildtest

HPC System and Software Testing Framework
https://buildtest.rtfd.io
MIT License
66 stars 19 forks source link

option to specify a different site configuration #258

Closed shahzebsiddiqui closed 4 years ago

shahzebsiddiqui commented 4 years ago

Currently there is no support for user to specify a different site configuration, it must be stored in $HOME/.buildtest/settings.yml.

Logically, it makes sense for buildtest build to have an option to specify path to site configuration they want to use instead of copying file everytime, this would make sense when a file sits in source control that user wants to make change instead of copying or moving file back-forth.

The option can be buildtest build -s or long option --site or --site-config. I am fine with with either long name. This could be relatively easy to do, currently we don't have -s so it could be a viable short option to use.

(docs) login4.stampede2(1035)$ buildtest build -h
usage: buildtest [options] [COMMANDS] build [-h] [-c TEST CONFIGURATION] [-t TESTDIR] [-e EXECUTOR] [-d]

optional arguments:
  -h, --help            show this help message and exit
  -c TEST CONFIGURATION, --config TEST CONFIGURATION
                        Specify test configuration file.
  -t TESTDIR, --testdir TESTDIR
                        specify a custom test directory. By default, use .buildtest in $PWD.
  -e EXECUTOR, --executor EXECUTOR
                        specify a named executor to use (defaults to "default" key, first in list, then local (base)
                        executor
  -d, --dry             dry-run mode, buildtest will not write the test scripts but print content of test that would
                        be written

This does mean that buildtest config view and buildtest config edit won't work with custom path to site config since they are looking at the default location.

Let me know your thoughts @vsoch. I would use this feature once i put site configuration for Stampede in https://github.com/HPC-buildtest/buildtest-stampede2

vsoch commented 4 years ago

That seems reasonable. I would not take s for this, however, but just use --settings since it corresponds to a settings.yml file. --site-config is also reasonable.

vsoch commented 4 years ago

I thought we removed buildtest config view? For buildtest config edit, it doesn't add much to allow the user to specify some default path to edit. If they need to specify the path, they can just open the file with their editor directly :)

shahzebsiddiqui commented 4 years ago

I thought we removed buildtest config view? For buildtest config edit, it doesn't add much to allow the user to specify some default path to edit. If they need to specify the path, they can just open the file with their editor directly :)

No we didnt remove buildtest config view same with edit. The one that was removed was buildtest show --config see https://github.com/HPC-buildtest/buildtest-framework/issues/215

I am not sure how relevant the view and edit option are going to be. Initially what i had in mind was having ability to edit and view site-configuration and test configuration file from buildtest. It could be useful for editing YAML files simply through command line if they are in some long cryptic path.

vsoch commented 4 years ago

Ah ok. For the buildtest config edit I think I mentioned this once before, but I really liked using it. I think we should keep it for the time being, it saves needing to remember and look up the file.

shahzebsiddiqui commented 4 years ago

Thats good to know, i think its fine for buildtest config [edit|view] to work for default configuration, if they have to specify an alternate configuration file which is scoped for this task then they might as well open file in editor.