@@ -17,9 +17,14 @@ def abcd():
1717 """Set up database connection."""
1818 port = int (os .environ .get ("port" , 9200 ))
1919 host = "localhost"
20- security_enabled = os .getenv ("security_enabled" ) == "true"
21- # credential = "admin:myStrongPassword123!"
22- credential = "admin:admin"
20+ # If running in CI, enable/disable security
21+ if os .getenv ("GITHUB_ACTIONS" ) == "true" :
22+ security_enabled = os .getenv ("security_enabled" ) == "true"
23+ else :
24+ # Otherwise assume local OpenSearch is enabled
25+ security_enabled = True
26+
27+ credential = "admin:myStrongPassword_123"
2328
2429 logging .basicConfig (level = logging .INFO )
2530
@@ -33,7 +38,7 @@ def abcd():
3338 return opensearch_abcd
3439
3540
36- def test_destroy (self , abcd ):
41+ def test_destroy (abcd ):
3742 """
3843 Test destroying database index.
3944 """
@@ -42,7 +47,7 @@ def test_destroy(self, abcd):
4247 assert abcd .client .indices .exists ("test_index" ) is False
4348
4449
45- def test_create (self , abcd ):
50+ def test_create (abcd ):
4651 """
4752 Test creating database index.
4853 """
@@ -52,7 +57,7 @@ def test_create(self, abcd):
5257 assert abcd .client .indices .exists ("fake_index" ) is False
5358
5459
55- def test_push (self , abcd ):
60+ def test_push (abcd ):
5661 """
5762 Test pushing atoms objects to database individually.
5863 """
0 commit comments