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

Unit testing #716

Merged
merged 8 commits into from
Sep 7, 2024
Merged

Unit testing #716

merged 8 commits into from
Sep 7, 2024

Conversation

naknomum
Copy link
Member

Reinstate unit testing with JUnit 5

  • pom.xml library updates and changes for maven to run tests
  • Initial example test for Annotations in AnnotationTest.java
  • new README


## JUnit for Unit Testing

Wildbook uses [JUnit 5](https://junit.org/junit5/docs/current/user-guide/) for unit testing. All unit tests _must run and pass_ in order for changes to be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for backend unit testing

Tests should be created under the `src/test/java/org/ecocean/` directories, corresponding to the java class which are testing. The test class name should follow
the convention of adding the suffix `Test` to the java class name, such as `AnnotationTest.java` for tests of code within `Annotation.java`.

Ultimately, almost all Wildbook java classes will have a corresponding `*Test.java` class. If one does not exist to add new tests to, it should be created
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately Eventually

"That being said, edits to existing classes may not require full understanding of a class, while testing does. If you choose not to make a unit test for an existing class, make a note of that choice in the PR and explain why."


## Integration Testing, Frontend Testing

TBD / linked elsewhere
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO TBD / linked elsewhere

Copy link
Member

@TanyaStere42 TanyaStere42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor edits and one big change to address a common case for tiny bug fixes

@TanyaStere42 TanyaStere42 mentioned this pull request Sep 4, 2024
@naknomum naknomum marked this pull request as ready for review September 6, 2024 23:02
Copy link
Member

@TanyaStere42 TanyaStere42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@TanyaStere42 TanyaStere42 merged commit c046540 into dev10.4 Sep 7, 2024
1 check passed
@TanyaStere42 TanyaStere42 deleted the unit_test_init branch September 7, 2024 01:36
Rodhlann pushed a commit to Rodhlann/Wildbook that referenced this pull request Dec 6, 2024
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