Commit 226d095
committed
test: replace MongoDB dependency with mocks and containerized tests
Replace ENABLE_MONGO_TESTS-gated tests with self-contained alternatives:
rest package uses moq-generated RulesMock with in-memory CRUD closures,
datastore package uses go-pkgz/testutils containerized MongoDB.
Add text_test.go and TestExtractByRule for extractor coverage.
Coverage: rest 20%->89%, datastore 68%->95%, extractor 87%->91%.1 parent 1b28637 commit 226d095
1,951 files changed
Lines changed: 436192 additions & 35502 deletions
File tree
- backend
- datastore
- extractor
- mocks
- rest
- vendor
- dario.cat/mergo
- github.com
- Azure/go-ansiterm
- winterm
- Microsoft/go-winio
- internal
- fs
- socket
- stringbuffer
- pkg/guid
- aws
- aws-sdk-go-v2
- aws
- arn
- defaults
- middleware
- protocol
- eventstream
- eventstreamapi
- query
- restjson
- xml
- ratelimit
- retry
- signer
- internal/v4
- v4
- transport/http
- config
- credentials
- ec2rolecreds
- endpointcreds
- internal/client
- processcreds
- ssocreds
- stscreds
- feature/ec2/imds
- internal/config
- internal
- auth
- smithy
- configsources
- context
- endpoints
- awsrulesfn
- v2
- ini
- middleware
- rand
- sdkio
- sdk
- strings
- sync/singleflight
- timeconv
- v4a
- internal
- crypto
- v4
- service
- internal
- accept-encoding
- checksum
- presigned-url
- s3
- internal
- arn
- customizations
- endpoints
- types
- ssooidc
- internal/endpoints
- types
- sso
- internal/endpoints
- types
- sts
- internal/endpoints
- types
- smithy-go
- auth
- bearer
- container/private/cache
- lru
- context
- document
- encoding
- httpbinding
- json
- xml
- endpoints
- private/rulesfn
- internal/sync/singleflight
- io
- logging
- metrics
- middleware
- private/requestcompression
- ptr
- rand
- sync
- time
- tracing
- transport/http
- internal/io
- waiter
- cenkalti/backoff/v4
- cespare/xxhash/v2
- containerd
- log
- platforms
- cpuguy83/dockercfg
- distribution/reference
- docker
- docker
- api
- types
- blkiodev
- checkpoint
- common
- container
- events
- filters
- image
- mount
- network
- registry
- storage
- strslice
- swarm
- runtime
- system
- time
- versions
- volume
- client
- errdefs
- internal
- lazyregexp
- multierror
- pkg
- archive
- idtools
- jsonmessage
- stdcopy
- go-connections
- nat
- sockets
- tlsconfig
- go-units
- ebitengine/purego
- internal
- cgo
- fakecgo
- strings
- felixge/httpsnoop
- go-logr
- logr
- funcr
- stdr
- go-ole/go-ole
- oleutil
- go-pkgz/testutils
- containers
- gogo/protobuf
- proto
- google/uuid
- hashicorp
- errwrap
- go-multierror
- jlaffaye/ftp
- kr/fs
- lufia/plan9stats
- magiconair/properties
- moby
- docker-image-spec
- specs-go/v1
- go-archive
- compression
- tarheader
- patternmatcher
- ignorefile
- sys
- sequential
- userns
- user
- term
- windows
- morikuni/aec
- opencontainers
- go-digest
- image-spec
- specs-go
- v1
- pkg
- errors
- sftp
- internal/encoding/ssh/filexfer
- openssh
- power-devops/perfstat
- shirou/gopsutil/v4
- common
- cpu
- internal/common
- mem
- net
- process
- sirupsen/logrus
- testcontainers/testcontainers-go
- exec
- internal
- config
- core
- network
- log
- wait
- tklauser
- go-sysconf
- numcpus
- yusufpapurcu/wmi
- go.opentelemetry.io
- auto/sdk
- internal/telemetry
- contrib/instrumentation/net/http/otelhttp
- internal
- request
- semconvutil
- semconv
- otel
- attribute
- internal
- xxhash
- baggage
- codes
- internal
- baggage
- global
- metric
- embedded
- noop
- propagation
- semconv
- v1.20.0
- v1.26.0
- v1.37.0
- trace
- embedded
- internal/telemetry
- noop
- golang.org/x
- crypto
- chacha20
- curve25519
- internal
- alias
- poly1305
- ssh
- internal/bcrypt_pbkdf
- sys
- cpu
- windows
- text/unicode/norm
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
23 | 42 | | |
24 | 43 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
32 | 54 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
26 | 206 | | |
27 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
28 | 210 | | |
29 | 211 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
72 | 216 | | |
73 | 217 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
77 | 224 | | |
78 | | - | |
79 | 225 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
107 | 231 | | |
108 | 232 | | |
109 | | - | |
110 | 233 | | |
111 | 234 | | |
112 | 235 | | |
| |||
0 commit comments