From 440019c712ac435fad9a43fc32ca9b01d48e8264 Mon Sep 17 00:00:00 2001 From: Thomas Calmant Date: Fri, 23 Aug 2024 13:26:13 +0200 Subject: [PATCH] Debug CI test --- .github/workflows/ci-build.yml | 25 +------------------------ tests/rsa/test_etcd3_discovery.py | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 338ef51d..1da8609d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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 @@ -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 diff --git a/tests/rsa/test_etcd3_discovery.py b/tests/rsa/test_etcd3_discovery.py index 98b3bd5f..1ee99ad8 100644 --- a/tests/rsa/test_etcd3_discovery.py +++ b/tests/rsa/test_etcd3_discovery.py @@ -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 @@ -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( [ @@ -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", @@ -102,14 +105,18 @@ 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, { @@ -117,6 +124,7 @@ def start_framework_for_advertise(state_queue: Queue): "service.exported.configs": "ecf.xmlrpc.server", }, ) + debug_queue.put_nowait("send ready") try: # Send that we are now ready state_queue.put("ready") @@ -145,6 +153,7 @@ def setUp(self): TestEndpointEventListener """ self.status_queue = Queue() + self.debug_queue = Queue() # start a local framework self.framework = create_framework( @@ -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) @@ -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