spdx / spdx-online-tools

Source for the website providing online SPDX tools
https://tools.spdx.org
Apache License 2.0
60 stars 57 forks source link

Fix test_checklicense_api #531

Open rtgdk opened 6 months ago

rtgdk commented 6 months ago

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.

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 commented 6 months ago

@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

goneall commented 6 months ago

@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.

rtgdk commented 6 months ago

@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