Visitar URL original
[TRACKER] Unit tests to add or improve · Issue #43440 · godotengine/godot · GitHub
Skip to content

[TRACKER] Unit tests to add or improve #43440

Open

Description

@Calinou

Our unit test coverage is currently fairly low. We'd like to increase our unit test coverage; any help is welcome.

Interested in writing new unit tests? See the unit tests documentation and compiling instructions.
If you have further questions, join the Godot Contributors Chat.

When opening a pull request, please link back to this issue (#43440) in the PR description so that we can keep track of it more easily.

If you have the appropriate permissions, feel free to edit this issue to add new items or check items for which a PR has been opened.

Classes to test

These classes are currently lacking in test coverage, and are therefore highest-priority for receiving unit tests. Deprecated classes are not listed.

Note

When a class is listed with "and" along a given list item, it should be submitted in the same pull request whenever possible. Tests for these classes can be in the same file or a different file depending on the size and complexity of the test suite. If in doubt, follow the file organization used in the original class implementation.

Completed classes

These classes currently have good test coverage. Further improvements may be possible by testing methods that were added after the tests were merged.

Details

Non-testable classes

These classes can't be unit-tested for technical reasons. Unit tests always run in headless mode, so they can't do things such as rendering scenes and checking the visual result.

Details
  • CubeMap: Not testable without RenderingServer access.
  • Shader: Not testable without RenderingServer access.
  • VisibleOnScreenNotifier2D: Not testable without RenderingServer access.
  • VisibleOnScreenNotifier3D: Not testable without RenderingServer access.

Activity

  1. Calinou commented on Nov 10, 2020

    @Calinou
    MemberAuthor

    @singher Thanks for your interest in contributing! I recommend joining the #godotengine-devel IRC channel on Freenode so you can ask development-related questions if needed.

    I also recommend writing a comment here when you're starting to write tests for one class. This way, we can avoid stepping on each other's toes.

  2. Xrayez commented on Nov 11, 2020

    @Xrayez
    Contributor

    we were planning on writing test cases for the following classes: Array, Dictionary, Node, RandomNumberGenerator.

    @vinayakmtiwari RandomNumberGenerator initial test suite is written in #43103 and #43343 for new (not yet merged) functionality, so I guess you could take it as a base.

  3. maxmutant commented on Nov 11, 2020

    @maxmutant
    Contributor

    I would like to tackle some of the test cases too and would start with the classes HashingContext and RegEx.
    Do you prefer separate PRs for each class, or should I aggregate them?

    Ps.: First time contributor here!

  4. Xrayez commented on Nov 11, 2020

    @Xrayez
    Contributor

    @MaxMutantMayer it's better to create separate PRs for each class, this eases the review process → potentially speeds up the merging process. 😉

    Also, I'd focus on one thing at a time.

  5. maxmutant commented on Nov 11, 2020

    @maxmutant
    Contributor

    @Xrayez Alright, makes sense. Thanks for clarification ☺️

  6. jonbonazza commented on Nov 13, 2020

    @jonbonazza
    Contributor

    Noting for posterity that @Calinou found several issues with the JSON facilities not conforming to the spec. He purposely left these unit tests out of the PR to not confuse people, but I created a proposal to address this: godotengine/godot-proposals#1833

  7. Gorgonx7 commented on Nov 16, 2020

    @Gorgonx7
    Contributor

    Hey if you don't mind I'm gonna take a crack at testing geometry 3D, it's also my first time contributing too :D

  8. Xrayez commented on Dec 8, 2020

    @Xrayez
    Contributor

    I had to write initial test suite for RandomNumberGenerator in #44089 with test cases for reproducibility, but not all public methods are currently tested.

  9. rmarco3e8 commented on Dec 12, 2020

    @rmarco3e8

    Hello, I'm also looking to start contributing and am writing tests for Path2D. If someone has already been working on that class, let me know. Thanks for the resources dropped earlier. I'll be sure to ask any questions in the Freenode channel.

  10. 403 remaining items

  11. added 6 commits that reference this issue on Aug 27, 2026
    5a888b9
    3fa2fca
    33041ba
    7332610
    bd0f331
    d410ac8
  12. deleted a comment from LeonxLJX on Sep 3, 2026
  13. anr1996 commented on Sep 12, 2026

    @anr1996

    Hello, I am a new contributor. This will be my first time! I was interested in writing unit tests. I thought it would be a good start. I'm somewhat new to C++. I was looking at StyleBoxFlat . However, I noticed that it is already being worked on. Would OptimizedTranslation be a good place to start writing unit tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions