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

Clean-up images after test script run #9

Merged
merged 3 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.7
0.0.8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This is a simple GitHub Action that checks Golang codebases for potential Nil panics.

Behind the hood, it uses Uber's `nilaway` static analysis tool.
Under the hood, it uses Uber's `nilaway` static analysis tool.
More useful information about it can be found in [this](https://www.uber.com/en-GB/blog/nilaway-practical-nil-panic-detection-for-go/)
Uber blog post or on their GitHub [repository](https://github.com/uber-go/nilaway).

Expand Down
6 changes: 5 additions & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_healthy_package(client, image):
logs = container.logs(stdout=True, stderr=True).decode("utf-8")
print(exit_code, "\n", logs)

container.stop()
container.remove()

assert exit_code["StatusCode"] == 0
Expand All @@ -38,6 +39,7 @@ def test_unhealthy_package(client, image):
logs = container.logs(stdout=True, stderr=True).decode("utf-8")
print(exit_code, "\n", logs)

container.stop()
container.remove()

assert exit_code["StatusCode"] != 0
Expand All @@ -46,13 +48,15 @@ def test_unhealthy_package(client, image):

def main():
client = docker.from_env()
image, _ = client.images.build(path="../", tag="nilaway-action-test-image")
image, _ = client.images.build(path="../", tag="nilaway-action-test-image", rm=True)

test_healthy_package(client, image)
test_unhealthy_package(client, image)

print("All tests passed!")

client.images.remove(image.id)


if __name__ == "__main__":
main()