Skip to content

Commit

Permalink
Update mock-es
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr committed Jun 5, 2024
1 parent 42c8bf9 commit 6913fa7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (
github.com/elastic/go-licenser v0.4.1
github.com/elastic/go-sysinfo v1.14.0
github.com/elastic/go-ucfg v0.8.8
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f
github.com/fatih/color v1.15.0
github.com/fsnotify/fsnotify v1.7.0
github.com/gofrs/flock v0.8.1
Expand All @@ -36,7 +37,6 @@ require (
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
github.com/josephspurrier/goversioninfo v0.0.0-20190209210621-63e6d1acd3dd
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7
github.com/leehinman/mock-es v0.0.0-20240429182736-ca60117f3957
github.com/magefile/mage v1.15.0
github.com/mitchellh/gox v1.0.1
github.com/mitchellh/hashstructure v1.1.0
Expand Down Expand Up @@ -180,6 +180,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mileusna/useragent v1.3.4 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQ
github.com/elastic/gojsonschema v1.2.1/go.mod h1:biw5eBS2Z4T02wjATMRSfecfjCmwaDPvuaqf844gLrg=
github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=
github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f h1:qo0Nn9G+p7HbG+CmiWwSoiKJ/cyRq59TRn9Z2PRHTi8=
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f/go.mod h1:mVdKBYYwt30xRFjCegbcURHh+3LWOCkQM33fgWbUiRI=
github.com/elastic/package-spec/v2 v2.6.0/go.mod h1:ks9/FaVOS+vCrGRQcDvXAd2FlmB84mrLikbRiO6ACuk=
github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA=
github.com/elastic/pkcs8 v1.0.0/go.mod h1:ipsZToJfq1MxclVTwpG7U/bgeDtf+0HkUiOxebk95+0=
Expand Down Expand Up @@ -1322,8 +1324,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
github.com/leehinman/mock-es v0.0.0-20240429182736-ca60117f3957 h1:jE5iCSPlxSsa2o5KOr+8rB/rogjjxB6nKfyWnjMo5kw=
github.com/leehinman/mock-es v0.0.0-20240429182736-ca60117f3957/go.mod h1:LXatisUwJ1ttE9W7iFi9XzrY9WdexSBVnHKtFcMIH0E=
github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg=
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b h1:11UHH39z1RhZ5dc4y4r/4koJo6IYFgTRMe/LlwRTEw0=
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg=
Expand Down Expand Up @@ -1406,6 +1406,8 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/mileusna/useragent v1.3.4 h1:MiuRRuvGjEie1+yZHO88UBYg8YBC/ddF6T7F56i3PCk=
github.com/mileusna/useragent v1.3.4/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc=
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
Expand Down
5 changes: 4 additions & 1 deletion testing/integration/logs_ingestion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ import (
"github.com/elastic/elastic-agent/testing/installtest"
"github.com/elastic/elastic-transport-go/v8/elastictransport"

mockes "github.com/leehinman/mock-es"
"github.com/rcrowley/go-metrics"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

mockes "github.com/elastic/mock-es/pkg/api"
)

func TestLogIngestionFleetManaged(t *testing.T) {
Expand Down Expand Up @@ -462,10 +463,12 @@ func getLogFilenames(
func startMockES(t *testing.T) string {
registry := metrics.NewRegistry()
uid := uuid.New()
clusterUUID := uuid.New().String()

mux := http.NewServeMux()
mux.Handle("/", mockes.NewAPIHandler(
uid,
clusterUUID,
registry,
time.Now().Add(time.Hour), 0, 0, 100, 0))

Expand Down

0 comments on commit 6913fa7

Please sign in to comment.