Code Monkey home page Code Monkey logo

Comments (10)

dingn1 avatar dingn1 commented on May 20, 2024

There is 400 lines in our report and the test being executed is only 329(405 executed, 329 actual all others seems to be duplicate as from the output). So I was wondering if there is a way to figure out which one are skipped automatically.

from knapsack.

dingn1 avatar dingn1 commented on May 20, 2024

As I can see from the code is it because of the sorting of how the reported test are read from the report? maybe we need a sort there also?

from knapsack.

ArturT avatar ArturT commented on May 20, 2024

As I can see from the code is it because of the sorting of how the reported test are read from the report? maybe we need a sort there also?

Could you provide link to the part of the code you mean?

I was wondering is there a way to check what's the files being executed?(is it only possible to look through the output in the CI pipeline)

You can run bundle exec rake knapsack:minitest and see knapsack logger output with list of tests that are going to be executed. Leftover tests are those not in knapsack report yet.
https://github.com/ArturT/knapsack/blob/master/lib/knapsack/runners/minitest_runner.rb#L8

There is 400 lines in our report and the test being executed is only 329(405 executed, 329 actual all others seems to be duplicate as from the output). So I was wondering if there is a way to figure out which one are skipped automatically.

If you removed or renamed the file spec/requests/api/artists_spec.rb from your repository then knapsack won't run it because it checks whether the test file found in the knapsack report actually exists.

If test file exists in test directory but not in knapsack report then the test file will be run (it's called leftover test).

If you want to track newly added or renamed test files just try https://knapsackpro.com for a few week or so and compare results with what you have now.

from knapsack.

dingn1 avatar dingn1 commented on May 20, 2024

The file is there and its in the report but its not executed(from the output on CI, no pipeline have it) and from the output I get from the CI, i found that there are some files that are running multiple times across different nodes. The line I talked about is https://github.com/ArturT/knapsack/blob/516aedd5ecf3bd0c900ca00e9da22d139e0f7d1d/lib/knapsack/distributors/leftover_distributor.rb#L5

From what I get the total number of test that got ran is correct but as there is so many duplicate a lot are actually skipped(for the output of file name that get executed 76 duplicates are there).

from knapsack.

ArturT avatar ArturT commented on May 20, 2024
  1. Do you use custom pattern KNAPSACK_TEST_FILE_PATTERN?
  2. Do you see duplicated files in knapsack report json?
  3. You could fork gem and try add uniq here report.keys.uniq
    https://github.com/ArturT/knapsack/blob/516aedd5ecf3bd0c900ca00e9da22d139e0f7d1d/lib/knapsack/distributors/leftover_distributor.rb#L5 and see how it works for you.

from knapsack.

dingn1 avatar dingn1 commented on May 20, 2024

We have KNAPSACK_TEST_FILE_PATTERN="spec/**{,/*/**}/*_spec.rb" no duplicate in the report.json file

from knapsack.

dingn1 avatar dingn1 commented on May 20, 2024

Thanks for your help got it fixed.

from knapsack.

ArturT avatar ArturT commented on May 20, 2024

Adding report.keys.uniq solved the problem? https://github.com/Vydia/knapsack/commit/566ef35123f8f8839067db27f36ce5435088e22d

Could you provide more context about the investigation you did? Is there a real bug in the gem then I'd like to fix that. If not then what was the root of your problem then?

from knapsack.

dingn1 avatar dingn1 commented on May 20, 2024

some of the configuration for running the test was wrong so however one of the pipeline is not executed on the CI. Its not a real bug.

from knapsack.

ArturT avatar ArturT commented on May 20, 2024

OK. Thank you!

from knapsack.

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.