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 unit tests #171

Open
bburns opened this issue Oct 25, 2022 · 7 comments
Open

Add unit tests #171

bburns opened this issue Oct 25, 2022 · 7 comments
Labels
enhancement New feature or request tests Test improvements or additions

Comments

@bburns
Copy link
Contributor

bburns commented Oct 25, 2022

No description provided.

@bburns bburns changed the title start adding unit tests to critical areas testing - start adding unit tests to critical areas Dec 15, 2022
@tukusejssirs tukusejssirs added this to the Backlog milestone Dec 15, 2022
This was referenced Dec 15, 2022
@MRIIOT
Copy link
Contributor

MRIIOT commented Dec 17, 2022

What are some examples of currently existing tests?
What are some examples of critical areas?

@bburns
Copy link
Contributor Author

bburns commented Dec 17, 2022

we don't have much in the way of tests yet - just some *-test.js files that run in node that were used to help develop the code, not geared towards automation.

critical areas would be any complex/confusing code - eg the jobboss shift handling, availability shift handling, adapter cache calculation code

could start by instrumenting that code for tests. along the way help make code more functional and easier to understand.

and for future code, i haven't had much luck sticking with TDD in other projects, but could try that going forward. @tukusejssirs what about you?

@tukusejssirs
Copy link
Contributor

tukusejssirs commented Dec 17, 2022

and for future code, i haven't had much luck sticking with TDD in other projects, but could try that going forward. @tukusejssirs what about you?

IMO having tests for all units (at the very least functions and methods) would be very nice, however, it takes some time to create robust tests. We could even track the test coverage.

While I was thinking about using TDD approach, however, I am more acustomed to be create the code first, then tests (after the code is more or less ready to merge, before merging), as the code change and while coding, I can create a list of test cases (based on the conditions in the code), which I can’t create out of the blue before the code is built.

IMO, we should try to add tests whenever when add new features or update (enhance, possible fix some bugs) the code. Or we could wait until a particular app is moved to Nx, then start adding the tests. In either case, there is no need to add all the unit tests systematically right now, as we don’t have the manpower for that right now.

@tukusejssirs tukusejssirs removed this from the Backlog milestone Dec 17, 2022
@MRIIOT
Copy link
Contributor

MRIIOT commented Dec 17, 2022

@bburns TDD requires specifications up front. It won't work without spec or design model.
@tukusejssirs Acceptance tests might be an option.

@bburns
Copy link
Contributor Author

bburns commented Dec 18, 2022

IMO, we should try to add tests whenever when add new features or update (enhance, possible fix some bugs) the code. Or we could wait until a particular app is moved to Nx, then start adding the tests.

Okay - it makes sense to start adding tests for new features after we move services into Nx, since it includes Jest.

Could start with the Meter service, since we'll be adding code for OEE there.

@tukusejssirs
Copy link
Contributor

Could start with the Meter service, since we'll be adding code for OEE there.

Yeah, I was about to ask you which app (service) would be (in your opinion) the easiest to move to Nx workspace first. I was thinking about one that does not depend on ther services (so that it could be easily tested without Docker). Moving the app itself is the easiest part, we need to adjust (a bit) global Nx config and probably the project-level config too. There are so many options …

Do you think that meter is the ‘right’ service to start the move to Nx? I was thinking about creating a test branch in my fork and then I’ll you guys for comments if my choices will be okay with you. WDYT, @bburns, @MRIIOT?

@MRIIOT
Copy link
Contributor

MRIIOT commented Dec 18, 2022

I would be OK with meter. @tukusejssirs go for it.

@tukusejssirs tukusejssirs added enhancement New feature or request tests Test improvements or additions labels Dec 22, 2022
@tukusejssirs tukusejssirs changed the title testing - start adding unit tests to critical areas Add unit tests Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests Test improvements or additions
Projects
None yet
Development

No branches or pull requests

3 participants