Skip to content

Update system caches tests#697

Merged
amol- merged 4 commits into
mainfrom
system-caches
Aug 4, 2025
Merged

Update system caches tests#697
amol- merged 4 commits into
mainfrom
system-caches

Conversation

@amol-

@amol- amol- commented Aug 1, 2025

Copy link
Copy Markdown
Collaborator

Intent

connect path to system caches has moved inside python-environments/_packages_cache, the test suite is still looking in the old path.

Type of Change

  • Bug Fix

@github-actions

github-actions Bot commented Aug 1, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-08-04 13:32 UTC

@github-actions

github-actions Bot commented Aug 1, 2025

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
5143 3993 78% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 2412208 by action🐍


# TODO: Unsure how to test log messages received from Connect.

# Admins cannot delete caches that do not exist

@amol- amol- Aug 1, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This test should not be here imho,
it's testing a connect behaviour not rsconnect-python.

We are already testing that deleting a cache does work, and we are already testing that reporting an error message from delete works:

  • test_system_caches_delete_admin
  • test_system_caches_delete_publisher

So this test didn't test anything additional and made the testsuite too dependant on a connect behaviours that didn't break compatibility with rsconnect itself.

@amol- amol- marked this pull request as ready for review August 1, 2025 10:02

@nealrichardson nealrichardson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a test-only fix? There's nothing in the code that needs to be adapted to point at the new cache location?


ADD_CACHE_COMMAND = "docker compose exec -u rstudio-connect -T rsconnect mkdir -p /data/python-environments/pip/1.2.3"
RM_CACHE_COMMAND = "docker compose exec -u rstudio-connect -T rsconnect rm -Rf /data/python-environments/pip/1.2.3"
ADD_CACHE_COMMAND = f"docker compose exec -u rstudio-connect -T rsconnect mkdir -p {CONNECT_CACHE_DIR}/pip/1.2.3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests that shell out to docker compose? We don't have to change that here, but that doesn't feel right, does it?

@amol- amol- Aug 1, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Definitely, there are a few Connect implementation details that are involved in rsconnect-python tests.
While Integration tests make sense, I believe they should treat connect as a blackbox.

For example, as far as "delete + list again" API calls confirm that the cache was actually deleted, we should not care if that happened for real or not on disk. Worst case, that would be a Connect bug and not a rsconnect one, and would be caught by connect tests. Rsconnect should start from the assumption that Connect does the right thing.

@amol-

amol- commented Aug 1, 2025

Copy link
Copy Markdown
Collaborator Author

This is a test-only fix? There's nothing in the code that needs to be adapted to point at the new cache location?

Yes, test only change as tests were failing on main
There shouldn't be any need to change rsconnect itself. When verifying the commands via shell they all worked as expected for me.
In the end the commands only invoke the Connect APIs, so rsconnect-python doesn't need to know where those caches are stored.

@amol- amol- merged commit 9f4ceb9 into main Aug 4, 2025
15 checks passed
@amol- amol- deleted the system-caches branch August 4, 2025 13:32
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