Skip to content

Commit a633c91

Browse files
committed
enable pants-plugins/uses_services mongo test_is_running
1 parent a285081 commit a633c91

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/test.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ jobs:
3939
python-version-short: '3.8'
4040
python-version: '3.8.10'
4141

42+
services:
43+
mongo:
44+
image: mongo:4.4
45+
ports:
46+
- 27017:27017
47+
4248
env:
4349
COLUMNS: '120'
4450

pants-plugins/uses_services/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ python_sources()
22

33
python_tests(
44
name="tests",
5+
overrides={
6+
# We use this plugin to validate we can run the tests for it.
7+
"mongo_rules_test.py": {"uses": ["mongo"]},
8+
}
59
)

pants-plugins/uses_services/mongo_rules_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ def platform(
109109
)
110110

111111

112-
# TODO: this requires that mongo be running...
113-
# def test_is_running(rule_runner: RuleRunner) -> None:
114-
# request = UsesMongoRequest()
115-
# mock_platform = platform()
116-
117-
# we are asserting that this does not raise an exception
118-
# is_running = run_mongo_is_running(rule_runner, request, mock_platform)
119-
# assert is_running
112+
# Warning this requires that mongo be running
113+
def test_is_running(rule_runner: RuleRunner) -> None:
114+
request = UsesMongoRequest()
115+
mock_platform = platform()
116+
117+
# we are asserting that this does not raise an exception
118+
is_running = run_mongo_is_running(rule_runner, request, mock_platform)
119+
assert is_running
120120

121121

122122
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)