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

Add guidelines for types of tests to write #796

Merged
merged 9 commits into from
Jan 22, 2021

Conversation

willschlitzer
Copy link
Contributor

As discussed in #771, this PR adds recommended guidelines to CONTRIBUTING.md for types of tests to write. It emphasizes testing on Python-specific code over GMT aliases and functions.

@willschlitzer
Copy link
Contributor Author

@weiji14 @seisman I added the recommendations we discussed, but I'm still a little confused on how we should address testing aliases and the basic creation of plots. I could see how someone could get confused looking at the testing guidelines, which don't recommend focusing on GMT aliases and functions, and then seeing that the majority of test files focus on testing the creation of plots and how the aliases work.

@willschlitzer willschlitzer added the documentation Improvements or additions to documentation label Jan 21, 2021
@willschlitzer willschlitzer added this to the 0.3.0 milestone Jan 21, 2021
@seisman
Copy link
Member

seisman commented Jan 21, 2021

then seeing that the majority of test files focus on testing the creation of plots and how the aliases work.

There may be some misunderstanding here. Could you point out some tests which you think don't follow the guidelines?

@willschlitzer
Copy link
Contributor Author

willschlitzer commented Jan 21, 2021

@seisman I probably should have specified that I'm looking at the plotting functions, as the majority of the tests that work with GMT under the hood don't focus on testing plotting aliases. Looking at test_colorbar.py there are a lot of tests passing different location inputs, test_coast.py has a lot of tests for the different arguments (some of which I've written), test_basemap.py has numerous tests creating different types of plots. I'm not opposed to these types of tests, but I want to avoid any confusion with the guidelines suggesting that those types of tests are unnecessary.

@seisman
Copy link
Member

seisman commented Jan 22, 2021

@seisman I probably should have specified that I'm looking at the plotting functions, as the majority of the tests that work with GMT under the hood don't focus on testing plotting aliases. Looking at test_colorbar.py there are a lot of tests passing different location inputs, test_coast.py has a lot of tests for the different arguments (some of which I've written), test_basemap.py has numerous tests creating different types of plots. I'm not opposed to these types of tests, but I want to avoid any confusion with the guidelines suggesting that those types of tests are unnecessary.

I see your points. Some of the tests were written years ago, and we didn't have any guidelines at that time (we're still learning to make the project better and developer-friendly).

If you look at the core codes of the colorbar() function, you will realize that the colorbar wrapper is pretty simple and almost has no Python-specific codes. However, we still need/want to add a few tests to make sure colorbar() works as expected. But I agree that some of the tests may be unnecessary.

@seisman seisman merged commit c91c6d2 into GenericMappingTools:master Jan 22, 2021
@willschlitzer willschlitzer deleted the testing-guidelines branch January 22, 2021 22:32
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants