-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Flyte Backend Version to pyflyte info command (#2938)
* Add backend version line to pyflyte info command Signed-off-by: davidlin20dev <[email protected]> * test: Add pyflyte info command versoin tests Signed-off-by: davidlin20dev <[email protected]> --------- Signed-off-by: davidlin20dev <[email protected]>
- Loading branch information
1 parent
ee4f9ab
commit 39e7227
Showing
2 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import subprocess | ||
import re | ||
|
||
def run_info_command() -> str: | ||
""" | ||
Runs the `pyflyte info` command and returns its output. | ||
""" | ||
out = subprocess.run( | ||
["pyflyte", "info"], | ||
capture_output=True, # Capture the output streams | ||
text=True, # Return outputs as strings (not bytes) | ||
) | ||
# Ensure the command ran successfully | ||
assert out.returncode == 0, (f"Command failed with return code {out.returncode}.\n" | ||
f"Standard Output: {out.stdout}\n" | ||
f"Standard Error: {out.stderr}\n") | ||
return out.stdout | ||
|
||
def test_info_command_versions(): | ||
""" | ||
Tests that the `pyflyte info` command outputs the correct version information. | ||
""" | ||
output = run_info_command() | ||
|
||
# Check that Flytekit Version is displayed | ||
assert re.search(r"Flytekit Version: \S+", output), "Flytekit Version not found in output." | ||
|
||
# Check that Flyte Backend Version is displayed | ||
assert re.search(r"Flyte Backend Version: \S+", output), "Flyte Backend Version not found in output." | ||
|
||
# Check that Flyte Backend Endpoint is displayed | ||
assert re.search(r"Flyte Backend Endpoint: \S+", output), "Flyte Backend Endpoint not found in output." |