Skip to content
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

tasks: Add integration test for image-refresh via issue-scan #588

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Mar 6, 2024

This covers the real thing in between getting the "issue" webhook data
and uploading the image to the S3 server, and hence issue-scan,
image-refresh, image-create, S3 image credentials, etc.

Extend mock-github for the operations that image-refresh does, like
converting an issue to a pull, posting test statuses, etc. These aren't
asserted: it's possible in principle with keeping state in the mock,
but these aren't the parts that are sensitive to us changing our bots
infrastructure. Also, these are better done in bots' unittests than this
integration test.


TODO:

  • validate the uploaded image

Rename it to "mock-github" and rename `--print-event` to
`--print-pr-event`. That way we can use it for other events, like an
issue with an image-refresh task.
This covers the real thing in between getting the "issue" webhook data
and uploading the image to the S3 server, and hence `issue-scan`,
`image-refresh`, `image-create`, S3 image credentials, etc.

Extend mock-github for the operations that `image-refresh` does, like
converting an issue to a pull, posting test statuses, etc. These aren't
asserted: it's  possible in principle with keeping state in the mock,
but these aren't the parts that are sensitive to us changing our bots
infrastructure. Also, these are better done in bots' unittests than this
integration test.
@martinpitt martinpitt force-pushed the image-refresh-test branch from 0f99819 to a1a1e5a Compare March 6, 2024 16:16
echo "--------------- mock image-refresh test log end -------------"
assert_in 'Running on:.*cockpituous' "$LOG"
assert_in './image-create.*foonux' "$LOG"
assert_in 'Uploading to' "$LOG" # TODO: make this more precise
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, forgot about that -- fixed.

@allisonkarlitskaya allisonkarlitskaya merged commit 493ee86 into main Mar 6, 2024
3 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the image-refresh-test branch March 6, 2024 16:36
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