bazel: Add container test for s3proxy (#62893)

* Add container test for s3proxy script

* Add explanatory comments

* Fixup s3proxy container structure test

* Update docs to mention a caveat of the setup steps

* Fix hostname
This commit is contained in:
Will Dollman 2024-05-24 14:02:37 +01:00 committed by GitHub
parent 1195dd9049
commit 3339660a77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -138,6 +138,13 @@ commandTests:
- -u
excludedOutput: ["^0"]
exitCode: 0
# Each command in the setup section will run in a separate container and then commits a modified image to be the new base image for the test run
- name: "fetch and test sg"
setup: [["wget", "https://github.com/sourcegraph/sg/releases/download/2024-05-23-19-04-d485d76e/sg_linux_amd64", "-O", "sg"], ["chmod", "+x", "sg"]]
command: "./sg"
args: ["--help"]
expectedOutput: ["The Sourcegraph developer tool"]
```
We can now build this image _locally_ and run those tests as well.

View File

@ -7,6 +7,15 @@ commandTests:
- -u
excludedOutput: ["^0"]
exitCode: 0
# This test runs as a single command, as commands run in the setup block are not executed in the same container as the command block
- name: "s3proxy test"
command: "sh"
args: [
"-c",
"/opt/s3proxy/run-docker-container.sh >/dev/null 2>&1 & sleep 5 && curl -X PUT --write-out %{http_code} http://localhost:9000/create-bucket-test-2022-01-09-attempt0"
]
expectedOutput: ["200"]
exitCode: 0
fileExistenceTests:
- name: 'Test for run-docker-container.sh'