@@ -44,21 +44,23 @@ func TestPrometheus(t *testing.T) {
44
44
45
45
t .Run ("Create MongoDB Resource" , mongodbtests .CreateMongoDBResource (& mdb , ctx ))
46
46
t .Run ("Basic tests" , mongodbtests .BasicFunctionality (& mdb ))
47
- t .Run ("Keyfile authentication is configured" , tester .HasKeyfileAuth (3 ))
48
- t .Run ("Test Basic Connectivity" , tester .ConnectivitySucceeds ())
49
47
50
- t .Run ("Test Prometheus endpoint is active" , tester .PrometheusEndpointIsReachable ("prom-user" , "prom-password" , false ))
51
- t .Run ("Ensure Authentication" , tester .EnsureAuthenticationIsConfigured (3 ))
52
- t .Run ("AutomationConfig has the correct version" , mongodbtests .AutomationConfigVersionHasTheExpectedVersion (& mdb , 1 ))
48
+ mongodbtests .SkipTestIfLocal (t , "Ensure MongoDB with Prometheus configuration" , func (t * testing.T ) {
49
+ t .Run ("Resource has TLS Mode" , tester .HasTlsMode ("requireSSL" , 60 , WithTls (mdb )))
50
+ t .Run ("Test Basic Connectivity" , tester .ConnectivitySucceeds (WithTls (mdb )))
51
+ t .Run ("Test Prometheus endpoint is active" , tester .PrometheusEndpointIsReachable ("prom-user" , "prom-password" , false ))
52
+ t .Run ("Ensure Authentication" , tester .EnsureAuthenticationIsConfigured (3 , WithTls (mdb )))
53
+ t .Run ("AutomationConfig has the correct version" , mongodbtests .AutomationConfigVersionHasTheExpectedVersion (& mdb , 1 ))
53
54
54
- t .Run ("Enabling HTTPS on the Prometheus endpoint" , func (t * testing.T ) {
55
- err = e2eutil .UpdateMongoDBResource (& mdb , func (mdb * v1.MongoDBCommunity ) {
56
- mdb .Spec .Prometheus .TLSSecretRef .Name = "tls-certificate"
57
- })
58
- assert .NoError (t , err )
55
+ t .Run ("Enabling HTTPS on the Prometheus endpoint" , func (t * testing.T ) {
56
+ err = e2eutil .UpdateMongoDBResource (& mdb , func (mdb * v1.MongoDBCommunity ) {
57
+ mdb .Spec .Prometheus .TLSSecretRef .Name = "tls-certificate"
58
+ })
59
+ assert .NoError (t , err )
59
60
60
- t .Run ("MongoDB Reaches Running Phase" , mongodbtests .MongoDBReachesRunningPhase (& mdb ))
61
- t .Run ("Test Prometheus HTTPS endpoint is active" , tester .PrometheusEndpointIsReachable ("prom-user" , "prom-password" , true ))
61
+ t .Run ("MongoDB Reaches Running Phase" , mongodbtests .MongoDBReachesRunningPhase (& mdb ))
62
+ t .Run ("Test Prometheus HTTPS endpoint is active" , tester .PrometheusEndpointIsReachable ("prom-user" , "prom-password" , true ))
63
+ t .Run ("AutomationConfig has the correct version" , mongodbtests .AutomationConfigVersionHasTheExpectedVersion (& mdb , 2 ))
64
+ })
62
65
})
63
- t .Run ("AutomationConfig has the correct version" , mongodbtests .AutomationConfigVersionHasTheExpectedVersion (& mdb , 2 ))
64
66
}
0 commit comments