spdx-online-tools icon indicating copy to clipboard operation
spdx-online-tools copied to clipboard

Fix test_checklicense_api

Open rtgdk opened this issue 10 months ago • 3 comments

Fixing #530

Had some free time, trying to make all tests run successfully - both locally and via PyCharm. PyCharm debugger is very helpful to fix these issues faster. Will be fixing more tests in app/tests.py as well.

  • Fixed test_checklicense_api where response structure changed
  • Fixed core.py with proper exception handling

Now only 2 tests in api are failing - both with rdf file Screenshot 2024-04-07 at 2 56 53 PM

@goneall Has there been any change with verifying RDF files. Both the remaining tests are failing as an exception is raised by verifyclass.verify JVM call to verify RDF files - 'org.spdx.library.model.SpdxIdInUseException: Can not create Apache-2.0. It is already in use with type License which is incompatible with type ListedLicense')

rtgdk avatar Apr 07 '24 09:04 rtgdk

@goneall Is there a better RDF file we can use for tests? The current one - https://github.com/spdx/spdx-online-tools/blob/main/src/examples/SPDXRdfExample-v2.0.rdf - raise issues like 'org.spdx.library.model.SpdxIdInUseException: Can not create Apache-2.0. It is already in use with type License which is incompatible with type ListedLicense'). Tried with this 2.1 version as well but same issue - https://github.com/spdx/tools/blob/master/Examples/SPDXRdfExample-v2.1.rdf

rtgdk avatar Apr 07 '24 09:04 rtgdk

@goneall Is there a better RDF file we can use for tests? The current one - https://github.com/spdx/spdx-online-tools/blob/main/src/examples/SPDXRdfExample-v2.0.rdf - raise issues like 'org.spdx.library.model.SpdxIdInUseException: Can not create Apache-2.0. It is already in use with type License which is incompatible with type ListedLicense'). Tried with this 2.1 version as well but same issue - https://github.com/spdx/tools/blob/master/Examples/SPDXRdfExample-v2.1.rdf

The test files in the tools-java repo should work - as long as we're using the same version of the java tools.

BTW - I'll be offline for the next 3 days or so, so may be a bit slow to respond.

goneall avatar Apr 07 '24 12:04 goneall

@goneall Thanks for the help! The new files worked perfectly! Now all the tests in api are passing, except one which is getting skipped. Will try to run that too after setting up test repos for submit license tool. Screenshot 2024-04-08 at 10 31 17 PM

rtgdk avatar Apr 08 '24 17:04 rtgdk