* Migrate tests from "cmd/mattermost/commands/team_test.go" to use testify #12410
* #12410: Simplify if checks
Migrate tests from "cmd/mattermost/commands/team_test.go" to use testify #12410
* Convert app/user_test.go t.Fatal calls into assert/require calls
* arrange expected and actual arguments as per semantics
* arrange expected and actual arguments as per go semantics
* fix for notEqual
* Convert config/watcher_test.go t.Fatal calls into require calls
* Moved wasCalled to a public helper function
Now the testutils package has a new function WasCalled
that can be used by anywhere.
We recently added support for handling SIGPIPE cleanly, in order to safely shutdown plugins in the event that the STDOUT/STDERR had been closed unexpectedly. Unfortunately, this signal is also emitted when writing to a closed socket connection: an event that occurs frequently for a webserver. Normally, if no signal handler is registered for same, the Go subsystem distinguishes the file descriptor and ignores those from the network. But once a handler is registered, all SIGPIPEs are passed through: and sadly there is no way to distinguish the original file descriptor.
We don't strictly need the SIGPIPE handling for development any longer since `make stop-server` no longer shuts down the logrus process which explained the majority of hanging plugin processes. It remains suboptimal that a signal can terminate the server and leave plugin processes hanging, but the current symptoms are worse.
* MM-18636: limit configuration writes to 4Mb
By default, MySQL silently truncates writes that exceed the column type in question. Change the column type from `TEXT` to `MEDIUMTEXT` to allow writes to the `Configurations` and `ConfigurationFiles` table to exceed 65535 bytes. This is a backwards compatible migration, but does require a rewrite of the table.
However, MySQL is further constrained by the default `max_allowed_packet` value of 4Mb, so limit writes accordingly.
Fixes: https://mattermost.atlassian.net/browse/MM-18636
* simplify unit tests
* fix import
* diagnostics_test.go: fix spacing
* diagnostics_test.go: explicitly assert payload
This fails, since the package is currently receiving struct pointers and won't set the MessageId or Timestamp on the corresponding Message.
* MM-18115: fix segment v3 usage
In v5.14, we updated [github.com/segmentio/analytics-go](https://github.com/segmentio/analytics-go) to v3 as part of https://mattermost.atlassian.net/browse/MM-12389. As noted in the [migration guide](https://segment.com/docs/sources/server/go/#migrating-from-v2), the API subtly changed to expect a struct value and not a struct pointer:
```go
// in v2, you would call the `Track` method with a `Track` struct.
client.Track(&track)
// in v3, you would call the `Enqueue` method with a `Track` struct.
// Note that a pointer is not used here.
client.Enqueue(track)
```
Unfortunately, we kept passing a pointer, and the package didn't complain since it only required an interface -- which the pointer to these structs still implemented. Internally, it only checked for the value types, and failed to annotate our payloads with the requisite metadata. Upstream, segment.io accepted the payload, but then discarded it silently.
This has since been reported and fixed in https://github.com/segmentio/analytics-go/pull/146, but isn't yet part of a tagged release of the package.
Fix our code to pass struct values instead.
Fixes: MM-18115