mendix / UnitTesting

Module to run Mendix and JUnit unit test inside a project
Apache License 2.0
7 stars 12 forks source link

Support running Unit tests by order. #51

Open hnguyen132 opened 6 months ago

hnguyen132 commented 6 months ago

I'm using this project for testing our Mendix project and it helps us to prevent a lot of issues before we go to production. I'm really glad and thankful to you guys.

When implementing the Unit testing for our project, we were getting trrouble with a defining test. Because our test steps all relate to each others and we require them running in order. To adapt the configuration, we are using the name convension that help us to sort the test steps by our desired order.

The problem is the Unit testing does not run with the correct order sometime and we get failure. It also messed up our database. Then we need to clean up our database manually by the SQL queries. That's dangeruos and annoying.

Please consider to have a way that allow us to sort all UnitTest and all TestSuite before running the UnitTesting.

Thanks.

Screenshot 2024-02-28 075200

SebastiaandenBoer commented 4 months ago

This would be the perfect use case for using the Setup and TearDown microflows to respectively prepare and clean up any data prerequisite to or generated by your test cases.

Testing best practices would imply your unit tests are independent of each other's result or running order, so I wouldn't expect this to be a feature in the Unit Test module.

Also, this would be quite challenging to implement in the module's current state due to each test being a separate transaction, which is often rolled back at the end of a test run. You would have to move this rollback to the suite level, which would result in unit tests not being able to be rolled back independently.

Although I understand your position, I would not support this feature.