@cryptotaxi247 / kubo / commits / 1b3e4438f

chore: upgrade OpenTelemetry dependencies (#9736)

Gus Eggert committed Apr 5, 2023 at 07:44 UTC 1b3e4438fc40adb4bd51df21ccb005c2b5a0f7a8
17 files changed +164 -109
.github/workflows/build.yml
+6 -6
@@ -20,8 +20,8 @@ jobs:
20 runs-on: ubuntu-latest
21 timeout-minutes: 5
22 env:
23 - TEST_NO_DOCKER: 1
24 - TEST_NO_FUSE: 1
23 + TEST_DOCKER: 0
24 + TEST_FUSE: 0
25 TEST_VERBOSE: 1
26 TRAVIS: 1
27 GIT_PAGER: cat
@@ -86,8 +86,8 @@ jobs:
86 runs-on: ubuntu-latest
87 timeout-minutes: 5
88 env:
89 - TEST_NO_DOCKER: 1
90 - TEST_NO_FUSE: 1
89 + TEST_DOCKER: 0
90 + TEST_FUSE: 0
91 TEST_VERBOSE: 1
92 TRAVIS: 1
93 GIT_PAGER: cat
@@ -126,8 +126,8 @@ jobs:
126 runs-on: ubuntu-latest
127 timeout-minutes: 5
128 env:
129 - TEST_NO_DOCKER: 1
130 - TEST_NO_FUSE: 1
129 + TEST_DOCKER: 0
130 + TEST_FUSE: 0
131 TEST_VERBOSE: 1
132 TRAVIS: 1
133 GIT_PAGER: cat
.github/workflows/gobuild.yml
+3 -3
@@ -20,7 +20,7 @@ jobs:
20 runs-on: ${{ fromJSON(needs.go-build-runner.outputs.config).labels }}
21 timeout-minutes: 20
22 env:
23 - TEST_NO_DOCKER: 1
23 + TEST_DOCKER: 0
24 TEST_VERBOSE: 1
25 TRAVIS: 1
26 GIT_PAGER: cat
@@ -38,7 +38,7 @@ jobs:
38 name: ${{ github.job }}
39 - run: make cmd/ipfs-try-build
40 env:
41 - TEST_NO_FUSE: 0
41 + TEST_FUSE: 1
42 - run: make cmd/ipfs-try-build
43 env:
44 - TEST_NO_FUSE: 1
44 + TEST_FUSE: 0
.github/workflows/golint.yml
+2 -2
@@ -17,8 +17,8 @@ jobs:
17 runs-on: ubuntu-latest
18 timeout-minutes: 10
19 env:
20 - TEST_NO_DOCKER: 1
21 - TEST_NO_FUSE: 1
20 + TEST_DOCKER: 0
21 + TEST_FUSE: 0
22 TEST_VERBOSE: 1
23 TRAVIS: 1
24 GIT_PAGER: cat
.github/workflows/gotest.yml
+2 -2
@@ -20,8 +20,8 @@ jobs:
20 runs-on: ${{ fromJSON(needs.go-test-runner.outputs.config).labels }}
21 timeout-minutes: 20
22 env:
23 - TEST_NO_DOCKER: 1
24 - TEST_NO_FUSE: 1
23 + TEST_DOCKER: 0
24 + TEST_FUSE: 0
25 TEST_VERBOSE: 1
26 TRAVIS: 1
27 GIT_PAGER: cat
.github/workflows/sharness.yml
+3 -3
@@ -49,9 +49,9 @@ jobs:
49 test/sharness/test-results/sharness.xml
50 working-directory: kubo
51 env:
52 - TEST_NO_DOCKER: 0
53 - TEST_NO_PLUGIN: 1
54 - TEST_NO_FUSE: 1
52 + TEST_DOCKER: 1
53 + TEST_PLUGIN: 0
54 + TEST_FUSE: 0
55 TEST_VERBOSE: 1
56 TEST_JUNIT: 1
57 TEST_EXPENSIVE: 1
Rules.mk
+1 -1
@@ -19,7 +19,7 @@ include mk/golang.mk
19 # extra properties #
20 # -------------------- #
21
22 -ifeq ($(TEST_NO_FUSE),1)
22 +ifeq ($(TEST_FUSE),0)
23 GOTAGS += nofuse
24 endif
25 export LIBP2P_TCP_REUSEPORT=false
coverage/Rules.mk
+1 -1
@@ -45,7 +45,7 @@ endif
45
46 export IPFS_COVER_DIR:= $(realpath $(d))/sharnesscover/
47
48 -$(d)/sharness_tests.coverprofile: export TEST_NO_PLUGIN=1
48 +$(d)/sharness_tests.coverprofile: export TEST_PLUGIN=0
49 $(d)/sharness_tests.coverprofile: $(d)/ipfs cmd/ipfs/ipfs-test-cover $(d)/coverage_deps test_sharness
50 (cd $(@D)/sharnesscover && find . -type f | gocovmerge -list -) > $@
51
go.mod
+6 -6
@@ -72,18 +72,15 @@ require (
72 github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1
73 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7
74 go.opencensus.io v0.24.0
75 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0
75 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.40.0
76 go.opentelemetry.io/otel v1.14.0
77 go.opentelemetry.io/otel/exporters/jaeger v1.14.0
78 - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
79 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
78 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0
79 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0
80 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0
81 go.opentelemetry.io/otel/exporters/zipkin v1.14.0
82 go.opentelemetry.io/otel/sdk v1.14.0
83 go.opentelemetry.io/otel/trace v1.14.0
86 - go.opentelemetry.io/proto/otlp v0.19.0 // indirect
84 go.uber.org/dig v1.15.0
85 go.uber.org/fx v1.18.2
86 go.uber.org/zap v1.24.0
@@ -113,7 +110,7 @@ require (
110 github.com/docker/go-units v0.5.0 // indirect
111 github.com/elastic/gosigar v0.14.2 // indirect
112 github.com/emirpasic/gods v1.18.1 // indirect
116 - github.com/felixge/httpsnoop v1.0.2 // indirect
113 + github.com/felixge/httpsnoop v1.0.3 // indirect
114 github.com/flynn/noise v1.0.0 // indirect
115 github.com/francoispqt/gojay v1.2.13 // indirect
116 github.com/gabriel-vasile/mimetype v1.4.1 // indirect
@@ -208,7 +205,10 @@ require (
205 github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa // indirect
206 github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
207 github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
211 - go.opentelemetry.io/otel/metric v0.30.0 // indirect
208 + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
209 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
210 + go.opentelemetry.io/otel/metric v0.37.0 // indirect
211 + go.opentelemetry.io/proto/otlp v0.19.0 // indirect
212 go.uber.org/atomic v1.10.0 // indirect
213 go.uber.org/multierr v1.9.0 // indirect
214 go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
go.sum
+6 -9
@@ -170,8 +170,8 @@ github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW
170 github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg=
171 github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
172 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
173 -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o=
174 -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
173 +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
174 +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
175 github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
176 github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=
177 github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
@@ -291,7 +291,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
291 github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
292 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
293 github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
294 -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
294 github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
295 github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
296 github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
@@ -922,9 +921,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
921 go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
922 go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
923 go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
925 -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE=
926 -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY=
927 -go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
924 +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.40.0 h1:lE9EJyw3/JhrjWH/hEy9FptnalDQgj7vpbgC2KCCCxE=
925 +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.40.0/go.mod h1:pcQ3MM3SWvrA71U4GDqv9UFDJ3HQsW7y5ZO3tDTlUdI=
926 go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
927 go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
928 go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q=
@@ -941,11 +939,10 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhqu
939 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w=
940 go.opentelemetry.io/otel/exporters/zipkin v1.14.0 h1:reEVE1upBF9tcujgvSqLJS0SrI7JQPaTKP4s4rymnSs=
941 go.opentelemetry.io/otel/exporters/zipkin v1.14.0/go.mod h1:RcjvOAcvhzcufQP8aHmzRw1gE9g/VEZufDdo2w+s4sk=
944 -go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c=
945 -go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU=
942 +go.opentelemetry.io/otel/metric v0.37.0 h1:pHDQuLQOZwYD+Km0eb657A25NaRzy0a+eLyKfDXedEs=
943 +go.opentelemetry.io/otel/metric v0.37.0/go.mod h1:DmdaHfGt54iV6UKxsV9slj2bBRJcKC1B1uvDLIioc1s=
944 go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
945 go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
948 -go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
946 go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
947 go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
948 go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
test/cli/harness/node.go
+23 -7
@@ -211,19 +211,29 @@ func (n *Node) Init(ipfsArgs ...string) *Node {
211 return n
212 }
213
214 -func (n *Node) StartDaemon(ipfsArgs ...string) *Node {
214 +// StartDaemonWithReq runs a Kubo daemon with the given request.
215 +// This overwrites the request Path with the Kubo bin path.
216 +//
217 +// For example, if you want to run the daemon and see stderr and stdout to debug:
218 +//
219 +// node.StartDaemonWithReq(harness.RunRequest{
220 +// CmdOpts: []harness.CmdOpt{
221 +// harness.RunWithStderr(os.Stdout),
222 +// harness.RunWithStdout(os.Stdout),
223 +// },
224 +// })
225 +func (n *Node) StartDaemonWithReq(req RunRequest) *Node {
226 alive := n.IsAlive()
227 if alive {
228 log.Panicf("node %d is already running", n.ID)
229 }
230 + newReq := req
231 + newReq.Path = n.IPFSBin
232 + newReq.Args = append([]string{"daemon"}, req.Args...)
233 + newReq.RunFunc = (*exec.Cmd).Start
234
220 - daemonArgs := append([]string{"daemon"}, ipfsArgs...)
235 log.Debugf("starting node %d", n.ID)
222 - res := n.Runner.MustRun(RunRequest{
223 - Path: n.IPFSBin,
224 - Args: daemonArgs,
225 - RunFunc: (*exec.Cmd).Start,
226 - })
236 + res := n.Runner.MustRun(newReq)
237
238 n.Daemon = res
239
@@ -232,6 +242,12 @@ func (n *Node) StartDaemon(ipfsArgs ...string) *Node {
242 return n
243 }
244
245 +func (n *Node) StartDaemon(ipfsArgs ...string) *Node {
246 + return n.StartDaemonWithReq(RunRequest{
247 + Args: ipfsArgs,
248 + })
249 +}
250 +
251 func (n *Node) signalAndWait(watch <-chan struct{}, signal os.Signal, t time.Duration) bool {
252 err := n.Daemon.Cmd.Process.Signal(signal)
253 if err != nil {
test/cli/harness/run.go
+12
@@ -142,3 +142,15 @@ func RunWithStdin(reader io.Reader) CmdOpt {
142 func RunWithStdinStr(s string) CmdOpt {
143 return RunWithStdin(strings.NewReader(s))
144 }
145 +
146 +func RunWithStdout(writer io.Writer) CmdOpt {
147 + return func(cmd *exec.Cmd) {
148 + cmd.Stdout = io.MultiWriter(writer, cmd.Stdout)
149 + }
150 +}
151 +
152 +func RunWithStderr(writer io.Writer) CmdOpt {
153 + return func(cmd *exec.Cmd) {
154 + cmd.Stderr = io.MultiWriter(writer, cmd.Stdout)
155 + }
156 +}
test/cli/testutils/requires.go
+3 -3
@@ -7,13 +7,13 @@ import (
7 )
8
9 func RequiresDocker(t *testing.T) {
10 - if os.Getenv("TEST_NO_DOCKER") == "1" {
10 + if os.Getenv("TEST_DOCKER") != "1" {
11 t.SkipNow()
12 }
13 }
14
15 func RequiresFUSE(t *testing.T) {
16 - if os.Getenv("TEST_NO_FUSE") == "1" {
16 + if os.Getenv("TEST_FUSE") != "1" {
17 t.SkipNow()
18 }
19 }
@@ -25,7 +25,7 @@ func RequiresExpensive(t *testing.T) {
25 }
26
27 func RequiresPlugins(t *testing.T) {
28 - if os.Getenv("TEST_NO_PLUGIN") == "1" {
28 + if os.Getenv("TEST_PLUGIN") != "1" {
29 t.SkipNow()
30 }
31 }
test/cli/tracing_test.go new
+89
@@ -0,0 +1,89 @@
1 +package cli
2 +
3 +import (
4 + "fmt"
5 + "os"
6 + "os/exec"
7 + "path/filepath"
8 + "strings"
9 + "testing"
10 + "time"
11 +
12 + "github.com/ipfs/kubo/test/cli/harness"
13 + "github.com/ipfs/kubo/test/cli/testutils"
14 + "github.com/stretchr/testify/assert"
15 + "github.com/stretchr/testify/require"
16 +)
17 +
18 +var otelCollectorConfigYAML = `
19 +receivers:
20 + otlp:
21 + protocols:
22 + grpc:
23 +
24 +processors:
25 + batch:
26 +
27 +exporters:
28 + file:
29 + path: /traces/traces.json
30 +
31 +service:
32 + pipelines:
33 + traces:
34 + receivers: [otlp]
35 + processors: [batch]
36 + exporters: [file]
37 +`
38 +
39 +func TestTracing(t *testing.T) {
40 + testutils.RequiresDocker(t)
41 + t.Parallel()
42 + node := harness.NewT(t).NewNode().Init()
43 +
44 + node.WriteBytes("collector-config.yaml", []byte(otelCollectorConfigYAML))
45 +
46 + // touch traces.json and give it 777 perms in case Docker runs as a different user
47 + node.WriteBytes("traces.json", nil)
48 + err := os.Chmod(filepath.Join(node.Dir, "traces.json"), 0777)
49 + require.NoError(t, err)
50 +
51 + dockerBin, err := exec.LookPath("docker")
52 + require.NoError(t, err)
53 + node.Runner.MustRun(harness.RunRequest{
54 + Path: dockerBin,
55 + Args: []string{
56 + "run",
57 + "--rm",
58 + "--detach",
59 + "--volume", fmt.Sprintf("%s:/config.yaml", filepath.Join(node.Dir, "collector-config.yaml")),
60 + "--volume", fmt.Sprintf("%s:/traces", node.Dir),
61 + "--net", "host",
62 + "--name", "ipfs-test-otel-collector",
63 + "otel/opentelemetry-collector-contrib:0.52.0",
64 + "--config", "/config.yaml",
65 + },
66 + })
67 +
68 + t.Cleanup(func() {
69 + node.Runner.MustRun(harness.RunRequest{
70 + Path: dockerBin,
71 + Args: []string{"stop", "ipfs-test-otel-collector"},
72 + })
73 + })
74 +
75 + node.Runner.Env["OTEL_TRACES_EXPORTER"] = "otlp"
76 + node.Runner.Env["OTEL_EXPORTER_OTLP_PROTOCOL"] = "grpc"
77 + node.Runner.Env["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://localhost:4317"
78 + node.StartDaemon()
79 +
80 + assert.Eventually(t,
81 + func() bool {
82 + b, err := os.ReadFile(filepath.Join(node.Dir, "traces.json"))
83 + require.NoError(t, err)
84 + return strings.Contains(string(b), "go-ipfs")
85 + },
86 + 5*time.Minute,
87 + 10*time.Millisecond,
88 + )
89 +}
test/sharness/Rules.mk
+1 -1
@@ -21,7 +21,7 @@ $(PLUGINS_$(d)): $(ORGIN_PLUGINS_$(d))
21 @mkdir -p $(@D)
22 cp -f plugin/plugins/$(@F) $@
23
24 -ifneq ($(TEST_NO_PLUGIN),1)
24 +ifneq ($(TEST_PLUGIN),0)
25 DEPS_$(d) += $(PLUGINS_$(d))
26 endif
27 endif
test/sharness/lib/test-lib.sh
+6 -6
@@ -94,10 +94,10 @@ export TERM=dumb
94 TEST_OS="$(uname -s | tr '[a-z]' '[A-Z]')"
95
96 # grab + output options
97 -test "$TEST_NO_FUSE" != 1 && test_set_prereq FUSE
97 +test "$TEST_FUSE" = 1 && test_set_prereq FUSE
98 test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
99 -test "$TEST_NO_DOCKER" != 1 && type docker >/dev/null 2>&1 && groups | egrep "\bdocker\b" && test_set_prereq DOCKER
100 -test "$TEST_NO_PLUGIN" != 1 && test "$TEST_OS" = "LINUX" && test_set_prereq PLUGIN
99 +test "$TEST_DOCKER" = 1 && type docker >/dev/null 2>&1 && groups | egrep "\bdocker\b" && test_set_prereq DOCKER
100 +test "$TEST_PLUGIN" = 1 && test "$TEST_OS" = "LINUX" && test_set_prereq PLUGIN
101
102 # this may not be available, skip a few dependent tests
103 type socat >/dev/null 2>&1 && test_set_prereq SOCAT
@@ -110,9 +110,9 @@ expr "$TEST_OS" : "CYGWIN_NT" >/dev/null || test_set_prereq STD_ERR_MSG
110 if test "$TEST_VERBOSE" = 1; then
111 echo '# TEST_VERBOSE='"$TEST_VERBOSE"
112 echo '# TEST_IMMEDIATE='"$TEST_IMMEDIATE"
113 - echo '# TEST_NO_FUSE='"$TEST_NO_FUSE"
114 - echo '# TEST_NO_DOCKER='"$TEST_NO_DOCKER"
115 - echo '# TEST_NO_PLUGIN='"$TEST_NO_PLUGIN"
113 + echo '# TEST_FUSE='"$TEST_FUSE"
114 + echo '# TEST_DOCKER='"$TEST_DOCKER"
115 + echo '# TEST_PLUGIN='"$TEST_PLUGIN"
116 echo '# TEST_EXPENSIVE='"$TEST_EXPENSIVE"
117 echo '# TEST_OS='"$TEST_OS"
118 echo '# TEST_JUNIT='"$TEST_JUNIT"
test/sharness/t0230-channel-streaming-http-content-type.sh
-2
@@ -23,7 +23,6 @@ test_ls_cmd() {
23 printf "HTTP/1.1 200 OK\r\n" >expected_output &&
24 printf "Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length\r\n" >>expected_output &&
25 printf "Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length\r\n" >>expected_output &&
26 - printf "Connection: close\r\n" >>expected_output &&
26 printf "Content-Type: text/plain\r\n" >>expected_output &&
27 printf "Server: kubo/%s\r\n" $(ipfs version -n) >>expected_output &&
28 printf "Trailer: X-Stream-Error\r\n" >>expected_output &&
@@ -47,7 +46,6 @@ test_ls_cmd() {
46 printf "HTTP/1.1 200 OK\r\n" >expected_output &&
47 printf "Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length\r\n" >>expected_output &&
48 printf "Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length\r\n" >>expected_output &&
50 - printf "Connection: close\r\n" >>expected_output &&
49 printf "Content-Type: application/json\r\n" >>expected_output &&
50 printf "Server: kubo/%s\r\n" $(ipfs version -n) >>expected_output &&
51 printf "Trailer: X-Stream-Error\r\n" >>expected_output &&
test/sharness/t0310-tracing.sh deleted
-57
@@ -1,57 +0,0 @@
1 -#!/usr/bin/env bash
2 -#
3 -# Copyright (c) 2022 Protocol Labs
4 -# MIT/Apache-2.0 Licensed; see the LICENSE file in this repository.
5 -#
6 -
7 -test_description="Test tracing"
8 -
9 -. lib/test-lib.sh
10 -
11 -test_init_ipfs
12 -
13 -export OTEL_TRACES_EXPORTER=otlp
14 -export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
15 -export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
16 -
17 -cat <<EOF > collector-config.yaml
18 -receivers:
19 - otlp:
20 - protocols:
21 - grpc:
22 -
23 -processors:
24 - batch:
25 -
26 -exporters:
27 - file:
28 - path: /traces/traces.json
29 -
30 -service:
31 - pipelines:
32 - traces:
33 - receivers: [otlp]
34 - processors: [batch]
35 - exporters: [file]
36 -EOF
37 -
38 -# touch traces.json and give it 777 perms, in case docker runs as a different user
39 -rm -rf traces.json && touch traces.json && chmod 777 traces.json
40 -
41 -test_expect_success "run opentelemetry collector" '
42 - docker run --rm -d -v "$PWD/collector-config.yaml":/config.yaml -v "$PWD":/traces --net=host --name=ipfs-test-otel-collector otel/opentelemetry-collector-contrib:0.52.0 --config /config.yaml
43 -'
44 -
45 -test_launch_ipfs_daemon
46 -
47 -test_expect_success "check that a swarm span eventually appears in exported traces" '
48 - until cat traces.json | grep CoreAPI.SwarmAPI >/dev/null; do sleep 0.1; done
49 -'
50 -
51 -test_expect_success "kill docker container" '
52 - docker kill ipfs-test-otel-collector
53 -'
54 -
55 -test_kill_ipfs_daemon
56 -
57 -test_done