olcf / olcf-test-harness

OLCF Test Harness
https://olcf.github.io/olcf-test-harness/
Other
12 stars 4 forks source link

Set default values for <obtain_from_environment> with [DEFAULT] section #184

Open ddietz89 opened 2 weeks ago

ddietz89 commented 2 weeks ago

If the reconcile fails here

https://github.com/olcf/olcf-test-harness/blob/816d6a766b1be8ec6f4da898449daa082f39a48b/harness/machine_types/rgt_test.py#L521

Could we grab a default value from a [DEFAULT] section in the config?

For example:

[DEFAULT]
nodes = 123

[Replacements]
job_name = GFDL_AVEC_c768L127nh
batch_queue = batch
nodes = <obtain_from_environment>
cluster = c6

The DEFAULT section currently works, however, only if the line is completely omitted. If you leave the variable unset, the harness code complains during reconciliation. Some logic could pull the value from the defaults if variable is unset in the environment (possibly continue throwing an error if there are other issues).

hagertnl commented 2 weeks ago

Also, improve the messaging when an obtain_from_environment is not found. For example ERROR: This test requires the environment variable RGT_NODES to be set., vs something more like ConfigParser error: nodes = <obtain_from_environment> is not found