-
Notifications
You must be signed in to change notification settings - Fork 161
feat(BA-984): Add Action Tests for Image
#4048
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
Conversation
Image
Image
a875b72
to
5969762
Compare
a9d334c
to
4582ba7
Compare
4582ba7
to
3a24196
Compare
d1a4f81
to
16090e9
Compare
2d0f6c7
to
d3dc584
Compare
16090e9
to
e99275f
Compare
b090bde
to
387fa73
Compare
effb5fa
to
818b1d0
Compare
8314580
to
8cdd6ad
Compare
@@ -44,6 +44,7 @@ | |||
) | |||
if project: | |||
stmt = stmt.where(ContainerRegistryRow.project == project) | |||
# TODO: Raise exception if registry not found or two or more registries found |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
bea6181
to
f8da2b9
Compare
@@ -301,7 +301,7 @@ async def rescan_images( | |||
# TODO: delete images removed from registry? | |||
|
|||
|
|||
type Resources = dict[SlotName, dict[str, Decimal]] | |||
type Resources = dict[SlotName, dict[str, Any]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you changed this? @jopemachine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a type error in the code below, so I temporarily changed it to Any, but I think it would be better to use int | str
or define an appropriate type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very strange that it's updated because of the test code, is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that I added an incorrect type in the recent PR I submitted.
if isinstance(col.type, sa.sql.sqltypes.DateTime): | ||
for row in rows: | ||
if col.name in row: | ||
row[col.name] = isoparse(row[col.name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't there a datetime value acceptor before? Why did you add it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the previous code for populate_fixture
, the logic for handling DateTime
types was missing, so an error occurs when generating a fixture that includes DateTime
columns like ImageRow.created_at
.
) | ||
instance.id = data.id | ||
return instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you put the ID value at creation time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the ID is injected from the database, the ID value passed through the constructor wouldn't be passed to the database, so I intentionally excluded it from the constructor.
@pytest.fixture | ||
def processors(extra_fixtures, database_fixture, database_engine, registry_ctx): | ||
agent_registry, _, _, _, _, _, _ = registry_ctx | ||
image_service = ImageService(db=database_engine, agent_registry=agent_registry) | ||
return ImageProcessors(image_service, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to image_processors
1e471ff
to
8aab5fd
Compare
b6bb29b
to
ded5ac5
Compare
Resolves #3964 (BA-984).
Based on #3997.
Test cases
Checklist: (if applicable)