-
Notifications
You must be signed in to change notification settings - Fork 602
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
JS Coverage #4131
JS Coverage #4131
Conversation
@ragesoss this is complete. The failing error is from prop type validation and it is indeed |
db/schema.rb
Outdated
@@ -260,7 +259,7 @@ | |||
t.index ["wiki_id"], name: "index_courses_wikis_on_wiki_id" | |||
end | |||
|
|||
create_table "faqs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t| | |||
create_table "faqs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these schema.rb changes are unrelated noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! This schema change always creeps up in my git diff everytime which is annoying. I'll revert this.
Looks like that's a bad prop type configuration, as I'm pretty sure (as exercised in the test) it's now the intended behavior to have ArticleViewer work with Wikipedia articles that don't have an Can you add a summary of the coverage results in the console? Otherwise, it doesn't do much good to run the coverage in travis-ci. |
After trying this out a little bit, I think the results showing up based on the concatenated webpack bundles rather than separately for each source file is the biggest limitation. This will make it too tedious to use the coverage stats as a quick way to identify frontend components that aren't being exercised in the feature specs (and too difficult to measure progress). Any ideas for getting closer to the kind of output we get from the |
I think if we disable vendors for test environment and then split the files manually and insert them instead of using main.js, we could have the report of individual files. Shall I try this approach? |
Does 'split the files manually' mean an entry in webpack config for every single source file? I guess if you can do it without a huge amount of work, it would be worth it just to get a snapshot of the main holes in coverage, even if it doesn't make sense to merge it that way. |
@ragesoss I got the splitting the files into its own entry points working, but hit up on another snag. Basically Webpack just goes through all the imports and dumps them in its own bundle. So, a I have asked a question on Stack Overflow - https://stackoverflow.com/questions/63304864/webpack-how-to-ignore-the-imported-files to see if there's a way to not include the |
@ragesoss can this be merged? I have added documents and cleaned up some code. The failures are probably due to some server error as they are passing on my local machine. If you can start this build again, it should pass. |
I'm still uncomfortable with a few things about this, which I think are fixable. In broad strokes, I don't think the implementation is isolated enough as an optional and test-only feature. In particular:
|
@ragesoss I have made the following changes:
|
Adds JS coverage for Feature Specs.
After the tests are run, the report can be viewed by running the server
rails s
and visiting localhost:3000/js_coverage/jscoverage.htmlThe workings are explained in comments.