mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
tests: Remove dependency on check.v1 (#5034)
This PR addresses a long standing dependency on `gopkg.in/check.v1` project used for our tests. All tests are re-written to use the go default testing framework instead. There was no reason for us to use an external package where Go tools are sufficient for this.
This commit is contained in:
@@ -175,6 +175,21 @@ func TestGetAPIEndpoints(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Ask the kernel for a free open port.
|
||||
func getFreePort() string {
|
||||
addr, err := net.ResolveTCPAddr("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
l, err := net.ListenTCP("tcp", addr)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer l.Close()
|
||||
return fmt.Sprintf("%d", l.Addr().(*net.TCPAddr).Port)
|
||||
}
|
||||
|
||||
// Tests for port availability logic written for server startup sequence.
|
||||
func TestCheckPortAvailability(t *testing.T) {
|
||||
// Make a port is not available.
|
||||
|
||||
Reference in New Issue
Block a user