fulldecent / structured-acceptance-test Goto Github PK
View Code? Open in Web Editor NEWAn open format definition for static analysis tools
License: MIT License
An open format definition for static analysis tools
License: MIT License
I merged a PR supposedly adding structured-acceptance-test support to my project, but now I get a nil error:
$ cucumber
Feature: Run example tests
Scenario: Running example tests # features/run_example_tests.feature:2
/Users/andrew/.gem/ruby/2.3.7/gems/structured-acceptance-test-0.0.6/lib/finding.rb:57:in `block in categories=': undefined method `include?' for nil:NilClass (NoMethodError)
from /Users/andrew/.gem/ruby/2.3.7/gems/structured-acceptance-test-0.0.6/lib/finding.rb:55:in `each'
from /Users/andrew/.gem/ruby/2.3.7/gems/structured-acceptance-test-0.0.6/lib/finding.rb:55:in `categories='
from /Users/andrew/go/src/github.com/mcandre/cowl/lib/cowl.rb:88:in `to_finding'
from /Users/andrew/go/src/github.com/mcandre/cowl/lib/cowl.rb:152:in `block in check'
from /Users/andrew/go/src/github.com/mcandre/cowl/lib/cowl.rb:151:in `each'
from /Users/andrew/go/src/github.com/mcandre/cowl/lib/cowl.rb:151:in `check'
from /Users/andrew/go/src/github.com/mcandre/cowl/bin/cowl:72:in `block in main'
from /Users/andrew/go/src/github.com/mcandre/cowl/bin/cowl:58:in `each'
from /Users/andrew/go/src/github.com/mcandre/cowl/bin/cowl:58:in `main'
from /Users/andrew/go/src/github.com/mcandre/cowl/bin/cowl:100:in `<top (required)>'
from /Users/andrew/.gem/ruby/2.3.7/bin/cowl:23:in `load'
from /Users/andrew/.gem/ruby/2.3.7/bin/cowl:23:in `<main>'
Given the program has finished # features/step_definitions/steps.rb:1
Then the output is correct for each test # features/step_definitions/steps.rb:12
expected: true
got: false
(compared using ==)
(RSpec::Expectations::ExpectationNotMetError)
features/run_example_tests.feature:4:in `Then the output is correct for each test'
Failing Scenarios:
cucumber features/run_example_tests.feature:2 # Scenario: Running example tests
1 scenario (1 failed)
2 steps (1 failed, 1 passed)
We may want to be compatible with them.
This is the test case:
bash example-process/example-process.bash | ruby stat-reader/stat-reader.rb
We want to get the expected output:
WARNING: Go to your room
WARNING: Go to your room
FAILURE: Go to your room
SUMMARY: 2 warnings, 1 failure
Importantly, the findings should be presented in realtime as they are output by the process.
stat-reader
to example-consumer
Accept format like this:
<?xml version='1.0' encoding='UTF-8'?>
<testsuites tests='4' failures='0'>
<testsuite name='Impostor_Tests.ImpostorGameModel_Tests' tests='3' failures='0'>
<testcase classname='Impostor_Tests.ImpostorGameModel_Tests' name='testElimanateAPlayer' time='0.067'/>
<testcase classname='Impostor_Tests.ImpostorGameModel_Tests' name='testGameStatusChangedWhenDoneShowingSecretWords' time='0.001'/>
<testcase classname='Impostor_Tests.ImpostorGameModel_Tests' name='testStartGameWithSamePlayers' time='0.003'/>
</testsuite>
<testsuite name='ImpostorUITests.ImpostorUITests' tests='1' failures='0'>
<testcase classname='ImpostorUITests.ImpostorUITests' name='testScreenshots' time='31.804'/>
</testsuite>
</testsuites>
And convert to STAT format.
With a script in the tools directory
Please fully document the Ruby API so it will show up at:
http://www.rubydoc.info/gems/structured-acceptance-test/0.0.6
Also document explicitly under Stat::to_json
to make it clear that people should NOT use this output to the terminal.
See this mistake: https://github.com/fulldecent/web-puc/blob/master/lib/web-puc.rb#L111-L113
Also please make a simple use example in the Ruby implementation README file.
Currently our Ruby implementation only supports JSON output. This is great for consumers, but linters prefer a more friendly looking output by default.
Let's make a great looking output option and add it into the Ruby implementation. It should look so good that linters will want to use our STAT implementation just to get this beautiful output.
⭐️ web-puc
⭐️ web-puc, version 0.0.2
🛑 Rule, description
(entire line is red)⚠️ Rule, description
(entire line is yellow)⚠️ Rule, description
(entire line is yellow) in index2.php
⚠️ Rule, description
(entire line is yellow) in index2.php, line 24
⚠️ Rule, description
(entire line is yellow) in index2.php, lines 24-26
⚠️ Rule, description
(entire line is yellow) in index2.php, line 24:15-18
⚠️ Rule, description
(entire line is yellow) in index2.php, line 24:15 to line 25:5
⚠️ Rule, description
(entire line is yellow) RECOMMENDATION: Reword to avoid the passive voice.
✅ PASSED with no warnings
(whole line is green)⚠️ PASSED with 5 warnings
(whole line is yellow)🛑 FAILED with 5 errors
(whole line is red)🛑 FAILED with 5 errors and 1 warning
(whole line is red)THIS ISSUE IS INCOMPLETE
A STAT data structure is created in #15. Extend this to add methods for incrementally reading a STAT data stream.
When you are reading, call backs will pass back data for the main STAT object and each finding.
The whole point is for this to be asynchronous.
Please design the API and recommend how it should look in an idiosyncratic ruby implementation.
An example computer program is produced that reads and reports the above output
It can do any type of reporting with it
Program should be in Ruby and very simple.
In Ruby, in a new tools directory.
Depends on: #1
http://jsonlines.org/examples/
Remove producer schema. Emit only findings. Standardize file name. Make that file loadable in VS Code.
Our primary supported format is JSON. Only if there is a standard, well documented translation from XML to JSON should we consider this.
If so, then let's also create a XML schema so that valid XML documents can be translated into JSON documents that are valid per JSON schema in #1.
The Atom editor has a [https://github.com/AtomLinter/linter-clang](built in tool for validating c code with clang) as you type. It takes the error output and displays it inline in the editor. Atom is consuming the compiler output.
We want to create a consumer that inhales the same information into a STAT data structure. Then this program will simply print out the STAT in json format.
stat-from-clang
it will read clang input and produce stat outputSee the working program already in tools/example-process/
example-process
in Ruby using our gemInclude pretty format with emoji rendering
This work will go in a new implementations/ruby
folder. Eventually this may moved to a new repository.
Also, please read the specification regarding incremental output. Please add three methods that allow incremental output:
{
) up to the first finding ("findings":[
), ends with a new line, and flushes output]
and }
and flushes outputThen when this is done:
Incremental reading will be added to this data structure in a separate issue.
Yup
Depends on #24
Create an Atom linter that uses the example-process
program from Atom.
Documentation: https://github.com/steelbrain/linter/tree/v1/docs
Discussion: steelbrain/linter#1298
Then people with STAT-compliant programs will have a VERY simple way to make their program compatible with Atom. They will only need to copy our example linter and change the name of the program that is run.
example-process
from the linter
linter-mixed-indent
which already handles calling an external programVerify that this tool works correctly by using Atom and creating an animated gif (I use licecap
). It should show one finding after 1 second, a second finding after a further 2 seconds and the final finding is shown after a further 3 seconds. It should NOT wait 6 seconds and show all three findings.
Discussion is here http://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout
Should this apply to us?
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.