Git Product home page Git Product logo

Comments (9)

2bndy5 avatar 2bndy5 commented on June 3, 2024 1

I might have to use a matrix in the CI to test various versions of python with various versions of clang-tools on various OSs... My new database test is failing in CI, but it passes fine locally.

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 3, 2024 1

The test coverage is already very high 👍

@2bndy5 I have created a org secret with a new codecov token and also removed codecov token for cpp-linter/clang-tools-pip, then rerun the test action of clang-tools-pip, it still works.

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 3, 2024

When --files-changed-only=ture, it should ignore submodules.
When --files-changed-only=false, analyze any source files in the repo including submodules.

So the current behavior of --files-changed-only=false is not expected?

I'm wondering if we should change files-changed-only default value to true. I guess users only care about modified files, not all source files.

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 3, 2024

When --files-changed-only=false, analyze any source files in the repo including submodules.

This was not my original intention. It doesn't make sense (to me) for a linter to be concerned with external sources. That's why in the README, I noted the ignore option can be used to explicitly include submodules (just not hidden folders that begin with a . like .github).

I'm wondering if we should change files-changed-only default value to true. I guess users only care about modified files, not all source files.

I have no objections to this. I think this was the original default until we started encouraging users to have a actions/checkout step. I also expect most users only want the file changes analyzed. Personally, I've been using this action to check all sources in my projects (for completeness because I itch for that 💯 ). I haven't been using clang-tidy for anything lately (but that may change in the future).

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 3, 2024

I'm almost ready to draft a PR... There's a lot of changes, so the description will be wordy. I'd like to learn a bit more about pytest (& plugins) to optimize the unit tests I've written.

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 3, 2024

It doesn't make sense (to me) for a linter to be concerned with external sources

I agree we should only analyze any source files and ignore submodules when --files-changed-only=false

No worries, take your time. I'm also learning about pytest to refactor my bad smell unit tests :(

from cpp-linter-action.

shenxianpeng avatar shenxianpeng commented on June 3, 2024

It also failed in my local environment.

/home/ubuntu/.local/lib/python3.8/site-packages/requests/adapters.py:501: ConnectionError
--------------------------------------------- Captured log call ---------------------------------------------
WARNING  CPP Linter:run.py:340 Could not find pcsound/pcsound.c! Did you checkout the repo?
========================================== short test summary info ==========================================
FAILED tests/lines_changed_only/test_lines_changed_only.py::test_run_clang_format_diff_only - requests.exc...
FAILED tests/lines_changed_only/test_lines_changed_only.py::test_run_clang_format_diff_adds - requests.exc...
================================= 2 failed, 22 passed in 257.41s (0:04:17) =================================

It's hang and failed from tests/lines_changed_only/test_lines_changed_only.py::test_run_clang_format_diff_only

tests/ignored_paths/test_ignored_paths.py::test_not_ignored PASSED                                    [ 83%]
tests/ignored_paths/test_ignored_paths.py::test_ignore_submodule PASSED                               [ 87%]
tests/lines_changed_only/test_lines_changed_only.py::test_lines_changed_only PASSED                   [ 91%]
tests/lines_changed_only/test_lines_changed_only.py::test_run_clang_format_diff_only 

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 3, 2024

It failed locally for you because it couldn't download the source files from the commit that I'm using in the test.

The test that failed for you was the lines-changed-only test. The one that failed in CI was the database test.

from cpp-linter-action.

2bndy5 avatar 2bndy5 commented on June 3, 2024

I've been playing with test coverage to see what else needs to be tested. So far I'm (locally) getting 94% coverage if I exclude any functions that directly use the REST API for thread comments:
image

I also configured coverage.py to ignore code specific to type checking and anything related to using rich as a logging extension, thus __init__.py is 100% covered. cpp_linter/thread_comments.py is also ignored because we would need a real CI event to test that code.

@shenxianpeng I see you've already created a codecov token for cpp-linter/clang-tools-pip. Can you create a org secret with a new codecov token, so we can use it for multiple repos? Or does the token have to specific to a project?

ps - Ensuring the best coverage has caused further improvements to the code base.

from cpp-linter-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.