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

test(version): merge component tests into unit tests #1187

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

raphinesse
Copy link
Contributor

I noticed that the only component tests we had were for the versions module and very similar to the corresponding unit tests. To keep things simple, this PR re-labels the tests as unit tests.

@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2021

Codecov Report

Merging #1187 (8242db2) into master (ea9751b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1187   +/-   ##
=======================================
  Coverage   75.03%   75.03%           
=======================================
  Files          13       13           
  Lines        1650     1650           
=======================================
  Hits         1238     1238           
  Misses        412      412           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea9751b...8242db2. Read the comment docs.

@erisu
Copy link
Member

erisu commented Nov 9, 2021

I believe these are not unit tests and they are also not component tests. Unit and component testing are the same things.

Component testing is defined as a software testing type, in which the testing is performed on each component separately without integrating with other components. It’s also referred to as Module Testing when it is viewed from an architecture perspective. Component Testing is also referred to as Unit Testing, Program Testing or Module Testing.

I might have created the component test but picked the wrong name.

These are supposed to be integration tests as it requires other components that are not apart of the library.

If we mocked the results and not actually call the externals for the versions, and only test what our methods does, then it is a unit test.

Anyways, since component and unit testing are the same thing, this PR is OK...

But to follow the terminology we should make sure it mocks the results, or pull them out as SI test.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

PR is OK but also read the previous comment...

@raphinesse
Copy link
Contributor Author

@erisu I agree that these tests are actually integration tests, and I think it's good that they are, i.e. I would not mock the external calls.

While I think it would be great to accurately categorize all tests, the test suites of most of our repos fail to do so. And I'm afraid that even if an effort would be made to improve that, it would be hard to make sure that future contributions maintain that new order.

That being said, we could change this PR to combine the version tests that actually call binaries and the create test into a new collection of integration tests. How do you feel about that?

@erisu
Copy link
Member

erisu commented Nov 9, 2021

I think the new collection of integration tests is a good idea but let's keep it as a separate PR and in the backlog.

I think we have been trying to push a lot of the major changes for the upcoming release (no ETA) and there is a lot of changes that have more priorities.

Some for example:

  • Keeping Cordova node logic in node_modules
  • The new cordova-js build system.

I agree about the

hard to make sure that future contributions maintain that new order.

As for this PR changes, I am OK and approved.

We can think about better testing practices later. My previous comment was a note of what I was thinking.

@raphinesse
Copy link
Contributor Author

100% agreed. Thanks for sharing your thoughts on this 👍

@raphinesse raphinesse merged commit be06cf4 into apache:master Nov 9, 2021
@raphinesse raphinesse deleted the no-component-tests branch November 9, 2021 08:41
@erisu erisu added this to the 7.0.0 milestone Nov 16, 2021
gazben pushed a commit to apicore-engineering/cordova-ios that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants