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

[th/output-base-option] add --output-base option to pre-determine the name of the result files #164

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

thom311
Copy link
Collaborator

@thom311 thom311 commented Nov 26, 2024

Currently, we have the "logs" configuration in the YAML config.
This defaults to "$PWD/ft-logs". The fact is that our YAML
config can contain more than one test configs ("tft-idx"). We
thus might write more than one result files and hence we allow
configuring the directory only.

But the chosen filenames contain timestamps. That is cumbersome as the
file name is no predictable from the user. The user will have to search
the output directory for files that look suitable.

Instead, add a command line option "--output-base" to "./main.py".
The user could use this like:

OUTPUT_BASE="$PWD/ft-logs/result-"
./main config.yaml -o "$OUTPUT_BASE"

The benefit is that afterwards you know you can find the result files
as "${OUTPUT_BASE}*.json", and you know which tft-idx corresponds to
which file.

Note that if you provide a relative path (or just a basename without a
path separator), then the filename is relative to the current working
directory. We don't fallback to the "logs" path from the config as it
seems more expected that a command line argument is relative to the
current directory. On the other hand, you can also specify a directory
name only (by appending a trailing '/'). That has the same effect as
setting the base for the filename to "result-".

@SalDaniele
Copy link
Collaborator

Nice to have, LGTM

Currently, we have the "logs" configuration in the YAML config.
This defaults to "$PWD/ft-logs". The fact is that our YAML
config can contain more than one test configs ("tft-idx"). We
thus might write more than one result files and hence we allow
configuring the directory only.

But the chosen filenames contain timestamps. That is cumbersome as the
file name is not predictable from the user. The user will have to search
the output directory for files that look suitable.

Instead, add a command line option "--output-base" to "./main.py".
The user could use this like:

  OUTPUT_BASE="$PWD/ft-logs/result-"
  ./main config.yaml -o "$OUTPUT_BASE"

The benefit is that afterwards you know you can find the result files
as "${OUTPUT_BASE}*.json", and you know which tft-idx corresponds to
which file.

Note that if you provide a relative path (or just a basename without a
path separator), then the filename is relative to the current working
directory. We don't fallback to the "logs" path from the config as it
seems more expected that a command line argument is relative to the
current directory.  On the other hand, you can also specify a directory
name only (by appending a trailing '/'). That has the same effect as
setting the base for the filename to "result-".
@thom311 thom311 force-pushed the th/output-base-option branch from 40a9e37 to 1e93660 Compare November 26, 2024 18:56
@thom311 thom311 merged commit 6a3a529 into ovn-kubernetes:main Nov 26, 2024
3 checks passed
@thom311 thom311 deleted the th/output-base-option branch November 26, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants