Skip to content

Commit

Permalink
Merge branch 'jmartin82:master' into go-1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi authored Sep 5, 2024
2 parents 912ae17 + e9640eb commit fa88c50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.6
FROM alpine:3.20

RUN apk --no-cache add \
ca-certificates curl
Expand All @@ -16,4 +16,4 @@ EXPOSE 8082 8083 8084

ENTRYPOINT ["mmock","-config-path","/config","-tls-path","/tls"]
CMD ["-server-ip","0.0.0.0","-console-ip","0.0.0.0"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=3s --retries=2 CMD curl -f http://localhost:8082 || exit 1
HEALTHCHECK --interval=30s --timeout=3s --start-period=3s --retries=2 CMD curl -fsS http://localhost:8082 || exit 1
12 changes: 10 additions & 2 deletions pkg/vars/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package vars
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -44,7 +46,13 @@ func TestReadFile(t *testing.T) {
func TestHTTPContent(t *testing.T) {
st := Stream{}

k := "http.contents(https://golang.org/)"
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("Go\n"))
}))
defer server.Close()

k := fmt.Sprintf("http.contents(%s)", server.URL)
holders := []string{k}

result := st.Fill(holders)
Expand All @@ -53,7 +61,7 @@ func TestHTTPContent(t *testing.T) {
t.Errorf("Stream key not found")
}

if !strings.Contains(v[0], "Go") {
if strings.TrimSpace(v[0]) != "Go" {
t.Errorf("Couldn't get the content. Value: %s", v)
}
}
Expand Down

0 comments on commit fa88c50

Please sign in to comment.