Skip to content

Commit

Permalink
Debug CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
tcalmant committed Aug 23, 2024
1 parent 85f663f commit 440019c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Use JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -42,21 +36,4 @@ jobs:
- name: Run unit tests
run: |
coverage run -m pytest tests
coverage combine
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
flag-name: python-${{ matrix.python-version }}
parallel: true

finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
pytest -s -vvv tests/rsa/test_etcd3_discovery.py
19 changes: 17 additions & 2 deletions tests/rsa/test_etcd3_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# ------------------------------------------------------------------------------


def start_framework_for_advertise(state_queue: Queue):
def start_framework_for_advertise(state_queue: Queue, debug_queue: Queue):
"""
Starts a Pelix framework to advertise (via etcd) a helloimpl_xmlrpc
remote service instance. The tests can/will then discover this
Expand All @@ -71,6 +71,7 @@ def start_framework_for_advertise(state_queue: Queue):
:param state_queue: Queue to communicate status and terminate
"""
try:
debug_queue.put_nowait("create")
# Start the framework
framework = create_framework(
[
Expand All @@ -90,10 +91,12 @@ def start_framework_for_advertise(state_queue: Queue):
"etcd.toppath": TEST_ETCD_TOPPATH,
},
)
debug_queue.put_nowait("start")
framework.start()

context = framework.get_bundle_context()
# Start an HTTP server, required by XML-RPC
debug_queue.put_nowait("instantiate")
with use_ipopo(context) as ipopo:
ipopo.instantiate(
"pelix.http.service.basic.factory",
Expand All @@ -102,21 +105,26 @@ def start_framework_for_advertise(state_queue: Queue):
)

bc = framework.get_bundle_context()
debug_queue.put_nowait("get rsa")
svc_ref = bc.get_service_reference(RemoteServiceAdmin, None)
assert svc_ref is not None
rsa = bc.get_service(svc_ref)
debug_queue.put_nowait(f"get rsa => {svc_ref} - {rsa}")
# export the hello remote service via rsa
# with the BasicTopologyManager, this will result
# in publish via etcd
debug_queue.put_nowait("get hello ref")
hello_ref = bc.get_service_reference("org.eclipse.ecf.examples.hello.IHello")
assert hello_ref is not None
debug_queue.put_nowait("export")
rsa.export_service(
hello_ref,
{
"service.exported.interfaces": "*",
"service.exported.configs": "ecf.xmlrpc.server",
},
)
debug_queue.put_nowait("send ready")
try:
# Send that we are now ready
state_queue.put("ready")
Expand Down Expand Up @@ -145,6 +153,7 @@ def setUp(self):
TestEndpointEventListener
"""
self.status_queue = Queue()
self.debug_queue = Queue()

# start a local framework
self.framework = create_framework(
Expand Down Expand Up @@ -178,7 +187,7 @@ def prepareFrameworkProcess(self):
"""
# start external framework that publishes remote service
self.publisher_process = WrappedProcess(
target=start_framework_for_advertise, args=[self.status_queue]
target=start_framework_for_advertise, args=[self.status_queue, self.debug_queue]
)
self.publisher_process.start()
state = self.status_queue.get(timeout=20)
Expand All @@ -193,7 +202,13 @@ def tearDown(self):
self.publisher_process.join(5)
self.publisher_process.close()
finally:
print("DEBUG")
while not self.debug_queue.empty():
print("Debug:", self.debug_queue.get_nowait())
print("END OF DEBUG")

self.status_queue.close()
self.debug_queue.close()
self.publisher = None

# Stop the framework
Expand Down

0 comments on commit 440019c

Please sign in to comment.