Skip to content

feat(BA-1561): Add session status history retriever test #4697

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

seedspirit
Copy link
Contributor

resolves #4682 (BA-1561)

@seedspirit seedspirit self-assigned this Jun 13, 2025
@github-actions github-actions bot added the size:M 30~100 LoC label Jun 13, 2025
@seedspirit seedspirit force-pushed the feat/add-session-status-history-retrieve-test branch from 60c5a9f to 7926f57 Compare June 17, 2025 01:26
@seedspirit seedspirit marked this pull request as ready for review June 17, 2025 01:26
@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Jun 17, 2025
Comment on lines 15 to 38
expected_status = set([
"PENDING",
"SCHEDULED",
"PREPARING",
"PULLING",
"PREPARED",
"CREATING",
"RUNNING",
"RESTARTING",
"RUNNING_DEGRADED",
"TERMINATING",
"TERMINATED",
"ERROR",
"CANCELED",
])

result = await session.ComputeSession(name=session_name).get_status_history()
assert result["result"] != "", "Status history should not be empty"
# NOTE: SessionStatus enum is not available due to BUILD rules
# NOTE: src/ai/backend/test/BUILD[//src/ai/backend/**] -> src/ai/backend/manager/BUILD[!*] : DENY
for status_key, status_value in result["result"].items():
assert status_key in expected_status, (
f"Status {status_key} is not a valid session status"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of test are you trying to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to test the session status history retrieval API is working properly and second, none of the retrieved status histories have unexpected session history values

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create tests for this part like, "In both success and failure scenarios, a specific history must have existed." I don't think it's necessary to verify parts that are already checked by type checking with test code again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As get_status_history only retrieve activate session history, I only defined test code with success scenario

@github-actions github-actions bot added the comp:manager Related to Manager component label Jun 17, 2025
@seedspirit seedspirit force-pushed the feat/add-session-status-history-retrieve-test branch 2 times, most recently from ee49c4a to 2cfcd00 Compare June 18, 2025 05:47
@github-actions github-actions bot added size:M 30~100 LoC and removed size:L 100~500 LoC labels Jun 18, 2025
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Jun 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jun 18, 2025
@seedspirit seedspirit force-pushed the feat/add-session-status-history-retrieve-test branch from 2cfcd00 to 2e71ffe Compare June 19, 2025 01:24
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Jun 19, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jun 19, 2025
@seedspirit seedspirit force-pushed the feat/add-session-status-history-retrieve-test branch from 2e71ffe to 813aa96 Compare June 19, 2025 05:21
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Jun 19, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jun 19, 2025
@seedspirit seedspirit force-pushed the feat/add-session-status-history-retrieve-test branch from 16b0e79 to 0765177 Compare June 19, 2025 07:00
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Jun 23, 2025
Merged via the queue into main with commit fa0099f Jun 23, 2025
26 checks passed
@HyeockJinKim HyeockJinKim deleted the feat/add-session-status-history-retrieve-test branch June 23, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component size:M 30~100 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Session test (Retrieve Status History)
3 participants