Skip to content

Add SOCI CLI root flag#1563

Merged
austinvazquez merged 2 commits into
awslabs:mainfrom
austinvazquez:add-soci-cli-root-flag
May 19, 2025
Merged

Add SOCI CLI root flag#1563
austinvazquez merged 2 commits into
awslabs:mainfrom
austinvazquez:add-soci-cli-root-flag

Conversation

@austinvazquez
Copy link
Copy Markdown
Contributor

@austinvazquez austinvazquez commented May 13, 2025

Issue #, if available:
When running unit tests on my local system, I regularly hit test failures for TestArtifactDB_DoesNotExist. I found the test setup could be more robust by ensuring db initialization fails to assert the desired behavior.

Description of changes:
This change 1) fixes the flaky unit test by ensuring the db initialization will fail during setup and 2) adds the --root global flag for the soci command along with refactoring common code between soci and soci-snapshotter-grpc commands.

Testing performed:
Added unit tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@austinvazquez
Copy link
Copy Markdown
Contributor Author

I have a few different motivations here. Let me chop it up some more.

The unit tests which asserts artifact db initialization failures will
result in errors was failing likely for previous good initialization of
the database.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
@austinvazquez austinvazquez force-pushed the add-soci-cli-root-flag branch from d241f33 to 5db7784 Compare May 13, 2025 15:24
@austinvazquez
Copy link
Copy Markdown
Contributor Author

Okay split this across two commits. The first commit fixes a flaky unit test, and the second adds the root flag to the soci command.

@austinvazquez austinvazquez marked this pull request as ready for review May 13, 2025 15:29
@austinvazquez austinvazquez requested a review from a team as a code owner May 13, 2025 15:29
Comment thread cmd/soci/commands/internal/snapshotter.go Outdated
Comment thread cmd/soci/commands/convert.go Outdated
This change adds --root flag for the soci command and refactors common
code with the snapshotter grpc for similar logic.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
@austinvazquez austinvazquez force-pushed the add-soci-cli-root-flag branch from 5db7784 to f4fc1fe Compare May 13, 2025 22:24
@github-actions github-actions Bot added go Pull requests that update Go code testing Unit and/or integration tests labels May 13, 2025
Copy link
Copy Markdown
Contributor

@sondavidb sondavidb left a comment

Choose a reason for hiding this comment

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

LGTM just one small thing I'd want considered for the unit test

Comment thread soci/artifacts_test.go
@austinvazquez austinvazquez merged commit ca55b7f into awslabs:main May 19, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code testing Unit and/or integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants