tuwilof / fitting Goto Github PK
View Code? Open in Web Editor NEWLibrary add improve test log for RSpec and WebMock, validate its according to API Blueprint and Open API, show the documentation coverage with log.
License: MIT License
Library add improve test log for RSpec and WebMock, validate its according to API Blueprint and Open API, show the documentation coverage with log.
License: MIT License
NoMethodError: undefined method `not_coverage' for #<Fitting::Route:0x007fabc5917c10>
/Users/vassilevsky/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/fitting-1.6.0/lib/fitting/statistics.rb:12:in `not_coverage?'
/Users/vassilevsky/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/fitting-1.6.0/lib/fitting.rb:48:in `run_specs'
/Users/vassilevsky/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:93:in `run'
/Users/vassilevsky/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
/Users/vassilevsky/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
/Users/vassilevsky/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
/Users/vassilevsky/.rbenv/versions/2.3.3-p0/bin/rspec:22:in `load'
/Users/vassilevsky/.rbenv/versions/2.3.3-p0/bin/rspec:22:in `<top (required)>'
high severity
Vulnerable versions: < 0.10.0
Patched version: 0.10.0
The package node-forge before 0.10.0 is vulnerable to Prototype Pollution via the util.setPath function. Note: Version 0.10.0 is a breaking change removing the vulnerable functions.
For the new fitting:report task
, need add check combination json-schema validation, as in the report rake 'fitting:documentation_responses[s]'
, 'fitting:documentation_responses[m]'
and 'fitting:documentation_responses[l]'
multi_json use for pretty json, bot can use default json lib
Have trouble with zsh terminal wrapper:
โ bundle exec rake fitting:tests_responses[xs]
zsh: no matches found: fitting:tests_responses[xs]
โ bundle exec rake fitting:tests_responses
need key xs
in bash all OK
Is there another way to set the size key?
I have doc.abip with long name method api, as long as I running bundle e rake fitting:report
This is the full trace running with debug:
ArgumentError: negative argument
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:18:in `*'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:18:in `block (2 levels) in output'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:16:in `each'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:16:in `inject'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:16:in `block in output'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:13:in `each'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:13:in `inject'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/fitting/report/console.rb:13:in `output'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/fitting-2.17.0/lib/tasks/fitting.rake:84:in `block (2 levels) in <top (required)>'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/unilog-2.5.2/lib/unilog/rake_logging.rb:7:in `block in invoke'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/unilog-2.5.2/lib/unilog.rb:92:in `within_context'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/unilog-2.5.2/lib/unilog/rake_logging.rb:4:in `invoke'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/bin/ruby_executable_hooks:22:in `eval'
/Users/antonkolmakov/.rvm/gems/ruby-3.0.1/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => fitting:report
Show tests without combinations in action page
Travis is not cool anymore. ;)
It would good for development if it skip documentation checking.
For example:
SKIP_FIT=1 bin/rspec
For the new fitting:report
task, need add action page, with details on action
If all methods is not documented in api.yml, they is not included in the stats.
Might be it also reproduce when some part of requests is not documented - I did not check it.
Need add method name in list tests without actions
Show tests without responses in action page
Now cover is always 100% if the response is without combinations
Fully conforming requests:
<LOTS OF METHODS>
Partially conforming requests:
Non-conforming requests:
API requests with fully implemented responses: 12 (100.0% of 12).
API requests with partially implemented responses: 0 (0.0% of 12).
API requests with no implemented responses: 0 (0.0% of 12).
API responses conforming to the blueprint: 35 (100.0% of 35).
API responses with validation errors or untested: 0 (0.0% of 35).
I think that there's no need to output empty sections and statistics for them.
Need to create new dir and generate files "tests_#{ENV['TEST_ENV_NUMBER']}.json". In rake comand use all files in new dir.
Total response cover becomes zero If combinations without tests. Need fix it
For the new fitting:report
task, need add test page, with details on test
JSON-Schemas and their combinations must be placed in separate files so as not to overload the main report file.
When running this script:
rake 'fitting:documentation[s]'
Will produce error:
No such file or directory - drafter
rake aborted!
TypeError: no implicit conversion of nil into String
Tasks: TOP => fitting:documentation
(See full trace by running task with --trace)
For the new fitting:report
task, need add check response code and json-schema validation, as in the report rake 'fitting:documentation_responses[xs]'
need delete match_schema
and
fitting/lib/fitting/configuration/yaml.rb
fitting/lib/fitting/configuration/legacy.rb
fitting/lib/fitting/configuration.rb
without js, only css and ruby rendor
because a lot dependabot alerts for this project
how in esplanade
funbox/esplanade@d5b3233
For the new fitting:report task, need add check METHOD and PATH (actions)
For the new fitting:report
task, to check the prefixes, we need to add an html view
I try to use white_list like this:
config.white_list = {
'/smth' => ['GET']
}
but in fitting/stats
file this resourse placed in black list.
then I use white list like this:
config.resource_white_list = {
'/smth' => ['GET /api/v1/smth']
}
and this works properly, but why I need to specify api prefix in array with methods descriptions?
Might be will be better to omit api prefix in this part too?
thank you for you time!
Expand the display of information about negative cases in a new report
To work with more than one prefix #35 we need to check them ๐
strict
JSON::Validator.fully_validate(json_schema, body.to, strict: true)
gem build fitting.gemspec
WARNING: open-ended dependency on rake (>= 12.3.3, development) is not recommended
if rake is semantically versioned, use:
add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
WARNING: See http://guides.rubygems.org/specification-reference/ for help
Successfully built RubyGem
Name: fitting
Version: 2.15.0
File: fitting-2.15.0.gem
if response without 100% cover, need pink color
For new report need add accordion for prefixes. This will make it easier to interact with a large number of actions.
There is get schemas with current response status in class Fitting::Response, but if status doesn't specify in tomogram it returns empty array and it pass validation. But must return not_documented.
need show more info about test
Since we need to work with more than one prefix.
Old tasks still have to work the old fashioned way ๐.
you need to automatically create a fitting folder otherwise an error
bundle e rake fitting:report
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - fitting/report.json
/Users/dima/.asdf/installs/ruby/2.7.1/bin/bundle:23:in `load'
/Users/dima/.asdf/installs/ruby/2.7.1/bin/bundle:23:in `<main>'
Tasks: TOP => fitting:report
(See full trace by running task with --trace)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.