Giter VIP home page Giter VIP logo

serverspec-example's People

Contributors

tolleiv avatar vincentbernat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverspec-example's Issues

Errno::EINVAL: Invalid argument - ./reports/spec

Looks like it is unable to instantiate the reports file for some reason. I am using
ruby 1.9.3p484 and rspec 2.14.8

** Invoke reports:clean
** Execute check:server:all
** Execute spec
** Invoke reports:build (first_time)
** Invoke spec
** Execute reports:build
rake aborted!
Errno::EINVAL: Invalid argument - ./reports/spec--2015-07-07T17:53:07.json
c:/Users/ssonker/cookbooks-downloaded/serverspec-example/Rakefile:160:in initia lize' c:/Users/ssonker/cookbooks-downloaded/serverspec-example/Rakefile:160:inopen'
c:/Users/ssonker/cookbooks-downloaded/serverspec-example/Rakefile:160:in `block
(2 levels) in <top (required)>'

Pivot the report table?

I started work on changing the orientation of the report tables, as I have lots of tests and fewer hosts. So I wanted hosts along top and tests as rows.

Is this something easily done in angular (it's new to me!) or should I transform the report data first?

reports:view not listing reports

This is great work, thanks for sharing it.

I've had to run my own httpd server without using your builtin reports:view option. With that option it does run everything well except it will not list available reports on the http://localhost:5000/viewer/#/upload page. Maybe it's a recent webrick change or a permissions problem but for some reason below the "choose file" button there is nothing else.
Any tips?

blank viewer page

Hello,

when loading the viewer in apache, or rubys http server all i get is a blank page.

Tested in chrome, firefox and safari on OSX.

Any ideas?

thanks

Grouping by line_number breaks dynamic Specs

In viewer/scripts/report.js you use the tuple (role,spec,line number) for identifying a rule.

...
// Get example identifier (role, spec, line number)
    var exampleIdentifier = function (e) {
        var matches = e.file_path.match(/^\.\/spec\/([^\/]+)\/([^\/]+)_spec\.rb$/);
        if (matches) {
            return [ matches[1], matches[2], e.line_number ];
        }
};
...
// We need to get a list of all tests in a topological order
        // for the current roleset. A test is a role, a spec file and
        // a line number.
        var tests = _.map(input, function(r) {
            // Keep only examples that match our roleset
            var examples = _.filter(r.results.examples, function(e) {
                return _.indexOf(rs, exampleRole(e)) != -1
            });
            return _.map(examples, exampleIdentifier);
        });
...

The line number approach breaks down, when you create dynamic spec item in order to avoid redundancies by replacing handcoded specs with data-driven tests. Consider this example (illustrative artificial pseudocode)

hosts.each do |hostname|
  describe host(hostname) do
    it { should be_reachable.with( :port => 443 ) }
  end  
end

The line number of the check is always the same. As a consequence, only the first spec is reported in the viewer.

Suggestion for the solution: Why not use the id field of the json report for identification purposes?

Make the output report table a rspec/serverspec output format

It is already possible to use an "output formatter", like --format html, to product an HTML output report. Would it be possible to convert your angular JS report table into such an output format, to remove the need for a web server/viewer?

I imaging a Jenkins job using the HTML Publisher that would run:

rake -m -j 5 check:server:all

and the table would be the final report.

The roles do not appear to filter the hosts to specific tests

Not sure if I followed this correctly.....but my understanding was....if the roles are defined in Rakefile and the hostname meets that role requirement...only tests under that role folder would be executed for that host. Tests under othe role folders would be ignored.
However...in the following case, it appears the tests under conscs are executed for each host in the hosts file.

Rakefile modification for hosts

# Return all roles of a given host
def roles(host)
  roles = [ "all" ]
  case host
  when /dmcs.+\-con/
    roles << "conscs"
  when /dmas.+\-con/
    roles << "consas"
  when /dmxpl.+\-con/
    roles << "consxpl"
  end
  roles
end

hosts file

dmcs12q-con-08
dmcs11q-con-08
dmas11q-con-08
dmas12q-con-08

Execution output

$ bundle exec rake spec
DL is deprecated, please use Fiddle
user@dmcs12q-con-08's password:
[OK      ] dmcs12q-con-08.
DL is deprecated, please use Fiddle
user@dmcs11q-con-08's password:
[OK      ] dmcs11q-con-08
DL is deprecated, please use Fiddle
user@dmas11q-con-08's password:
[33 /37  ] dmas11q-con-08
DL is deprecated, please use Fiddle
user@dmas12q-con-08's password:
[33 /37  ] dmas12q-con-08

I tried running bundle exec rake check:role:conscs, but it fails after the second host as

$ bundle exec rake check:role:conscs
DL is deprecated, please use Fiddle
user@dmcs12q-con-08's password:
[OK      ] dmcs12q-con-08
DL is deprecated, please use Fiddle
user@dmcs11q-con-08's password:
[OK      ] dmcs11q-con-08
rake aborted!
Errno::EINVAL: Invalid argument @ rb_sysopen - ./reports/check:role:conscs--2015
-07-10T14-06-28.json
c:/Users/user/cookbooks/documentum-serverspec-scripts/Rakefile:167:in `initia
lize'
c:/Users/user/cookbooks/documentum-serverspec-scripts/Rakefile:167:in `open'
c:/Users/user/cookbooks/documentum-serverspec-scripts/Rakefile:167:in `block
(2 levels) in <top (required)>'
c:/Users/user/cookbooks/documentum-serverspec-scripts/Rakefile:210:in `block
in <top (required)>'
Tasks: TOP => reports:build
(See full trace by running task with --trace)

Is it possible that my regex is not evaluating all hosts in the rakefile in roles section?

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.