Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated tests #8

Open
vvoovv opened this issue Nov 30, 2020 · 11 comments
Open

Automated tests #8

vvoovv opened this issue Nov 30, 2020 · 11 comments
Assignees

Comments

@vvoovv
Copy link
Member

vvoovv commented Nov 30, 2020

I am going to introduce automated tests. That will require some changes in python scripts located in the debug or tests directories.

@vvoovv vvoovv self-assigned this Nov 30, 2020
@vvoovv
Copy link
Member Author

vvoovv commented Nov 30, 2020

I'd like to ask if you need matplotlib charts inside the python scripts located in the debug or tests directories.

@vvoovv
Copy link
Member Author

vvoovv commented Dec 1, 2020

Here is how a test looks like:
test_52964943_leiden_geregracht_50.py

Note 3 functions at the end of the script with the test_ prefix.

@vvoovv
Copy link
Member Author

vvoovv commented Dec 1, 2020

Probably two scripts are needed:

  • for debugging
  • for the automated tests

Is the 3D matplotlib chart needed for debugging? What else is needed for debugging. I can add the required stuff to the generator of the scripts for debugging.

@polarkernel
Copy link
Collaborator

Here is how a test looks like:
test_52964943_leiden_geregracht_50.py

A script like this example is OK for me. I use all the debugging stuff in a development version of bpypolyskel.py, where I am able to visualize the intermediate results of the process. The only thing I need is the execution of polygonize() with the test data.

@vvoovv
Copy link
Member Author

vvoovv commented Dec 1, 2020

I suggest generating a ready to debug Python script that doesn't require any editing or copy and pasting. Could you please provide an example script?

@polarkernel
Copy link
Collaborator

Could you please provide an example script?

I do not need any edit using your example. The only thing that would simplify things a little bit would be the possibility to start it from the test folder. But then I end always in the ImportError "attempted relative import with no known parent package", when trying to import from the parent folder.

But don't do too much. Finding the bug is normally a matter of hours, I do not win much time when I don't need to move the script.

@vvoovv
Copy link
Member Author

vvoovv commented Dec 1, 2020

The following works for me:
python.exe -m debug.64893921_toulouse_boulevard_gabriel_koenigs_83.py

It means executing the script as a Python module from the top-level directory of bpypolyskel library.

@polarkernel
Copy link
Collaborator

It means executing the script as a Python module from the top-level directory of bpypolyskel library.

OK, I see what you mean. But I like to execute it in my development environment (I use VS Code), so that I can debug it in detail. There I could not find a similar soltution. But don't care, I have no problem as it is.

@vvoovv
Copy link
Member Author

vvoovv commented Dec 8, 2020

Added more automated tests.

@vvoovv
Copy link
Member Author

vvoovv commented Dec 11, 2020

Add the automated tests for two special case: rectangle and square.

@vvoovv
Copy link
Member Author

vvoovv commented Jan 12, 2021

Finished the documentation for testing:
https://github.com/prochitecture/bpypolyskel/wiki/Testing

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

No branches or pull requests

2 participants