Skip to content

Commit

Permalink
fix(smoke): fix timeseries delete test's usage of datahub get (#11330)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Sep 8, 2024
1 parent 607ad5e commit 80f493a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion smoke-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ task installDev(type: Exec) {
commandLine 'bash', '-c',
"set -x && " +
"${python_executable} -m venv ${venv_name} && " +
"${venv_name}/bin/python -m pip install --upgrade pip uv wheel setuptools && " +
"${venv_name}/bin/python -m pip install --upgrade uv && " +
"set +x && source ${venv_name}/bin/activate && set -x && " +
"uv pip install -r requirements.txt && " +
"touch ${venv_name}/.build_install_dev_sentinel"
Expand Down
2 changes: 1 addition & 1 deletion smoke-test/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else

python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip 'uv>=0.1.10' wheel setuptools
python -m pip install --upgrade 'uv>=0.1.10'
uv pip install -r requirements.txt
fi

Expand Down
18 changes: 11 additions & 7 deletions smoke-test/tests/cli/delete_cmd/test_timeseries_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,20 @@ def datahub_get_and_verify_profile(
sync_elastic()
get_args: List[str] = ["get", "--urn", test_dataset_urn, "-a", test_aspect_name]
get_result: Result = runner.invoke(datahub, get_args)
assert get_result.exit_code == 0
try:
get_result_output_obj: Dict = json.loads(get_result.stdout)
except JSONDecodeError as e:
print("Failed to decode: " + get_result.stdout, file=sys.stderr)
raise e

if expected_profile is None:
assert not get_result_output_obj
assert get_result.exit_code != 0
assert (
test_dataset_urn in get_result.stderr and "not found" in get_result.stderr
), f"Got stderr of {get_result.stderr} in get_and_verify_profile"
else:
assert get_result.exit_code == 0
try:
get_result_output_obj: Dict = json.loads(get_result.stdout)
except JSONDecodeError as e:
print("Failed to decode: " + get_result.stdout, file=sys.stderr)
raise e

profile_from_get = DatasetProfileClass.from_obj(
get_result_output_obj["datasetProfile"]
)
Expand Down

0 comments on commit 80f493a

Please sign in to comment.