-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integ-cli: Implement remote FakeStorage server for build via URL tests
Implemented a FakeStorage alternative that supports spinning up a remote container on DOCKER_TEST_HOST to serve files over an offline-compiled Go static web server image so that tests which use URLs in Dockerfile can build them over at the daemon side. `fakeStorage` function now automatically chooses if it should use a local httptest.Server or a remote container. This fixes the following tests when running against a remote daemon: - `TestBuildCacheADD` - `TestBuildCopyWildcardNoFind` - `TestBuildCopyWildcardCache` - `TestBuildADDRemoteFileWithCache` - `TestBuildADDRemoteFileWithoutCache` - `TestBuildADDRemoteFileMTime` - `TestBuildADDLocalAndRemoteFilesWithCache` - `TestBuildADDLocalAndRemoteFilesWithoutCache` - `TestBuildFromURLWithF` - `TestBuildApiDockerFileRemote` Signed-off-by: Ahmet Alp Balkan <[email protected]>
- Loading branch information
Showing
7 changed files
with
177 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM busybox | ||
EXPOSE 80/tcp | ||
COPY httpserver . | ||
CMD ["./httpserver"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
fs := http.FileServer(http.Dir("/static")) | ||
http.Handle("/", fs) | ||
log.Panic(http.ListenAndServe(":80", nil)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.