Skip to content

Commit

Permalink
Clean-up images after test script run (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgospodinow authored Feb 11, 2024
1 parent 8e11a62 commit f7fc08f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
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()

0 comments on commit f7fc08f

Please sign in to comment.