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

Fix ERROR M310 when directory name starts with . #137

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

jeromecoutant
Copy link
Contributor

@github-actions
Copy link

github-actions bot commented Feb 17, 2022

Unit Test Results

  6 files  12 suites   2s ⏱️
17 tests 17 ✔️ 0 💤 0
51 runs  51 ✔️ 0 💤 0

Results for commit 21f4240.

♻️ This comment has been updated with latest results.

@jeromecoutant
Copy link
Contributor Author

Merging [#137] will decrease coverage by 13.87%.

I think there is an issue in Codecov tool....

thorstendb-ARM
thorstendb-ARM previously approved these changes Feb 17, 2022
@jkrech jkrech requested a review from JonatanAntoni February 22, 2022 08:53
@JonatanAntoni
Copy link
Collaborator

JonatanAntoni commented Feb 22, 2022

I think there is an issue in Codecov tool....

Yes, the CodeCoverage seems to be not properly configured. We need to check.

Can we add some tests for this function?

  • Reproduce the original issue.
  • Verify the fix does the job.

@jeromecoutant
Copy link
Contributor Author

Can we add some tests for this function?

I think it's done :-)

Reproduce the original issue.

With only the commit with the new test:

$ cmake --build . --target packchk --target PackChkIntegTests

$ ctest -C Debug -R PackChkIntegTests

Test project C:/github/OpenCMSISPack/devtools/build
    Start 13: PackChkIntegTests
1/1 Test #13: PackChkIntegTests ................***Failed    1.27 sec

[  FAILED  ] PackChkIntegTests.CheckPackWithDot (7 ms)
Verify the fix does the job.

With the patch:

$ cmake --build . --target packchk --target PackChkIntegTests

$ ctest -C Debug -R PackChkIntegTests
1/1 Test #13: PackChkIntegTests ................   Passed    1.45 sec

@JonatanAntoni
Copy link
Collaborator

JonatanAntoni commented Feb 28, 2022

Looks promising. I think we could add a unit test in addition to the integration test.
I am not yet convinced that this routine handles all situations, properly.

Copy link
Collaborator

@JonatanAntoni JonatanAntoni left a comment

Choose a reason for hiding this comment

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

The coverage reports turns out that the code range under discussion is not properly hit by the provided tests.

<component Cclass="TestClass" Cgroup="TestGlobal" Cversion="1.0.0" condition="Test_Condition">
<description>TestGlobal</description>
<files>
<file category="source" name=".Files/test1.c"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are we trying to test here? Filenames starting with a . should be legal. At least on unix-like systems such files/directories are considered "hidden".
Didn't we discuss (and test) for names starting with ./? I.e., the unix-like shortcut for "current working directory"?

Copy link

Choose a reason for hiding this comment

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

Yes, the intention is to support these "hidden" elements.
At least ".directory" should be accepted as we plan to use it to collect all the files an end-user does not really need to "see".

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, so this test actually does not verify the removal of ./ prefixes, intentionally. So we definitively need to add some more tests, probably unit tests, to really cover the implementation.

@jeromecoutant
Copy link
Contributor Author

So we definitively need to add some more tests, probably unit tests, to really cover the implementation

Any update ?
Thx

@fred-r
Copy link

fred-r commented Mar 22, 2022

What can we do about the codecov issue blocking the merge ?

@jeromecoutant
Copy link
Contributor Author

@JonatanAntoni any update ?
Thx

@JonatanAntoni
Copy link
Collaborator

@jeromecoutant,

We need to provide more tests to be sure the function does what is expected.
Please rebase your patch and add some tests which cover the code under modification.

Cheers,
Jonatan

@jeromecoutant
Copy link
Contributor Author

Please rebase your patch and add some tests which cover the code under modification.

Done

@JonatanAntoni
Copy link
Collaborator

@jeromecoutant, after merging #262 please consider rebasing this PR to keep contributing your integration test. Actually, we should already have everything covered with the unit tests but the additional integ test would not harm.

@jeromecoutant
Copy link
Contributor Author

@JonatanAntoni ?

@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #137 (21f4240) into main (a484c1f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #137   +/-   ##
=======================================
  Coverage   66.60%   66.60%           
=======================================
  Files          24       24           
  Lines        4734     4734           
=======================================
  Hits         3153     3153           
  Misses       1581     1581           
Flag Coverage Δ
packchk-cov 47.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@JonatanAntoni JonatanAntoni self-requested a review April 20, 2022 08:12
@JonatanAntoni JonatanAntoni merged commit d8ecf4c into Open-CMSIS-Pack:main Apr 20, 2022
@jeromecoutant jeromecoutant deleted the PR_M310 branch April 20, 2022 10:26
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.

packchk : wrong ERROR M310 ?
4 participants