Skip to content

Conversation

@marscher
Copy link
Member

@marscher marscher commented Apr 5, 2025

deals with #827

import faulthandler
faulthandler.enable()
faulthandler.disable()
except: ## tODO: too broad exception handling

Check notice

Code scanning / CodeQL

Except block handles 'BaseException' Note test

Except block directly handles BaseException.
@codecov
Copy link

codecov bot commented Apr 6, 2025

Codecov Report

Attention: Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.09%. Comparing base (fa54bca) to head (06670a4).
Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
jpype/_core.py 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1268      +/-   ##
==========================================
+ Coverage   86.87%   87.09%   +0.22%     
==========================================
  Files         113      113              
  Lines       10336    10356      +20     
  Branches     4065     4064       -1     
==========================================
+ Hits         8979     9020      +41     
+ Misses        761      741      -20     
+ Partials      596      595       -1     
Files with missing lines Coverage Δ
jpype/__init__.py 95.12% <100.00%> (ø)
jpype/_jarray.py 100.00% <100.00%> (ø)
jpype/_jcollection.py 100.00% <100.00%> (ø)
jpype/_jvmfinder.py 61.53% <100.00%> (ø)
native/common/jp_context.cpp 77.89% <100.00%> (+4.00%) ⬆️
native/python/pyjp_module.cpp 81.91% <100.00%> (ø)
jpype/_core.py 84.53% <85.71%> (-0.19%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Thrameos
Copy link
Contributor

I see you are working on one of those maintenance tasks. Which release are you targeting this for? We currently have three largish changes in the pipeline.

  • extend Java objects from Python
  • A Java to Python bridge
  • Modules

Not sure how long it will take to integrate it all but that does mean fairly substantial changes in the repo. You may want to not hold a maintenance PR too long in queue or it risks conflicts with the others.

Additionally, in order to test the reverse bridge I will need to push it into a branch on the main project as the release pipeline can only be triggered there. I will remove the branch once it is complete. The merge will happen as a regular PR.

@marscher
Copy link
Member Author

We could also post pone this one in favor of the important changes. I can tidy up things later and do not want to interfere with the integration of the the main features.

@Thrameos
Copy link
Contributor

I hate to lose work that you put in. I gave this a look over. There were two problems when I ran it locally that would need to be addressed.

The assertion on the harness built is okay. But getting hundreds of failed tests on the same failed assertion is not very useful. I changed that to pytest.exit(). Running from a raw checkout shows that we have three actions before a pytest will run.

  1. harnesses need to be built
  2. org.jpype.jar must be found
  3. the dependency libs need to be pulled.

I believe all these things happen in our azure scripts, but a local user won't get those.

Next up, the one of the changes to subrun is definitely bad for me locally. It appears that subrun now tries to start the JVM. But many of the tests are built around the JVM not having been started. At least locally that caused every subrun test to fail on me. Not sure why it passes on azure. Reverting the changes fixed my local copy.

Also my pyproject.toml gave an error on the license file under Python 3.12.

You can see the changes in I required in.

https://github.com/Thrameos/jpype/tree/testing_updates

Beyond those changes what else is required to merge this in?


def testCallWithArray(self):
h2 = JClass('jpype.attr.Test1')()
h2 = JClass('org.jpype.test.attr.Test1')()

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable h2 is not used.

def testCallWithArrayMismatch(self):
h2 = JClass('jpype.attr.Test1')()
h2 = JClass('org.jpype.test.attr.Test1')()

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable h2 is not used.
class MroTestCase(common.JPypeTestCase):
def testMro(self):
C = JClass('jpype.mro.C')
C = JClass('org.jpype.test.mro.C')

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable C is not used.
proxy = JProxy("jpype.proxy.TestInterface1", dict=d)
proxy = JProxy(["jpype.proxy.TestInterface1"], dict=d)
proxy = JProxy("org.jpype.test.proxy.TestInterface1", dict=d)
proxy = JProxy(["org.jpype.test.proxy.TestInterface1"], dict=d)

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning test

This assignment to 'proxy' is unnecessary as it is
redefined
before this value is used.
proxy = JProxy(["jpype.proxy.TestInterface1"], dict=d)
proxy = JProxy("org.jpype.test.proxy.TestInterface1", dict=d)
proxy = JProxy(["org.jpype.test.proxy.TestInterface1"], dict=d)

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable proxy is not used.
def testMethods(self):
fixture = JClass("jpype.common.Fixture")()
fixture = JClass("org.jpype.test.common.Fixture")()

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable fixture is not used.
def testMethods2(self):
fixture = JClass("jpype.common.Fixture")()
fixture = JClass("org.jpype.test.common.Fixture")()

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable fixture is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants