GithubHelp home page GithubHelp logo

kfatehi / bait Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 867 KB

build and integration tester / ci server

License: MIT License

Ruby 15.31% Shell 0.95% CSS 78.36% CoffeeScript 1.82% JavaScript 3.57%

bait's People

Contributors

kfatehi avatar mixflame avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

mixflame dfti

bait's Issues

Purge feature

Provide a button on the UI to purge all the builds

Bait::ObjectiveC::Project needs to be more helpful

In order to prepare the objective c source files for a clean static compilation, we should add a new feature to Bait::ObjectiveC::Project

So instead of this:

  path = File.expand_path('../..')
  project = Bait::ObjectiveC::Project.new(path)

  app.vendor_project path, :static, source_files: project.h_files.concat(project.m_files)

We must be able to do this instead

  path = File.expand_path('../..')
  vendor_path = File.expand_path(File.join(File.dirname(__FILE__), 'vendor'))
  project = Bait::ObjectiveC::Project.new(path)

  # The next line causes 2 things:
  # dependencies are copied to vendor_path, retaining relative path therein
  # their #import directives are made to be absolute paths to the files in the vendor_path
  project.rewrite_imports :absolute, vendor_path 

  # project.source_files will just concat the h and m files behind the scenes
  app.vendor_project vendor_path, :static, source_files: project.source_files

Security

Currently anyone can make a malicious project and push it to a known instance of bait and create their own shell or take over the box.

This should be solved by establishing a convention whereby github is pushing to a URL containing an API key.

In addition there should be basic authentication of some sort for the UI

Retest button needs to work smarter

When I click Retest on the UI, it should not just append the output. Instead I would rather persist "Runs".

Perhaps add a ToyStore#list called "test_runs" which contains the stdout and test pass result. (has_many test_runs, but its called list :test_runs, TestRun or something, see ToyStore Readme)

Then refactor build#passed? to grab the last test run and base its decision from it.

Calabash Report

When calabash runs, it outputs a report. Just like SimpleCov, we should check and see if report/index.html exists and do all the same stuff..

It may be possible to generalize this.

Another caveat is that the only reason that report is generated, and in the report/ folder to begin with is because i've set my test.sh to run cucumber in that way, it's entirely non-standard.

Phase-based refactor

Test Phase

Placing a test.sh file in your bait folder will run the "test" phase. That is all ...

Analysis Phases

Supported Languages

(in truth, they are all supported, just write a script...) First one will be #44


Using a bait.yml file the user will order the bait phases

---
 - test.sh
 - coffeelint.sh

Autoscope scripts

I should be able to get away with not having this in every script:

#!/bin/bash
bait_dir=$(dirname $0)
project_dir="$bait_dir/.."
cd $project_dir

Automatically do a chdir to eliminate the need for this.

Setup a RubyMotion fixture

Make sure that you can write a simple test script that will work for a rubymotion project. throw that sucker into fixtures.

Build log expander

The build logs should be collapsed by default and have a "more" button to expand it

Collecting Repositories as a single Project

In order to prepare for a release of dependent applications (e.g. an iOS app and a Rails app)

A Project can contain multiple repositories. This is defined by the URL setup in the post-receive hook.

A Unique name will define the collection.

See the CI Workflow diagram to determine further specification

Lint coffeescript

If a .bait/coffeelint.sh file exists, it will be executed as the "coffeelint" phase.

Example

$bait_dir/coffeescript
# npm install coffeelint if you dont have it, you might do this in a first priority bootstrap phase/script
File.each ...
coffeelint -f $bait_dir/config/coffeelint.json <files>
# Perhaps make this a Ruby shebang (ensure ruby in a previous script) and use https://github.com/zipcodeman/coffeelint-ruby
# it's up to the user how they want to use it
  • Add Better script to README

Virtualization

I'm finding myself hesitating to setup bait for some of my larger ruby projects. Why? Because I'm not using RVM on this particular box.

Bait is awesome and simple as it stands right now -- but perhaps one of the first configuration options it should get is to virtualize for tests. How? Well, we have Vagrant at our disposal.

It would be pretty trivial to enable the bait server owner to flick on an option to use Vagrant.

The first step towards this ticket would probably be to use slop instead of the current Bait::CLI module, then to establish a convention for config -- at first this can just be a flag passed into bait.

This ticket is in development and might get trashed, I'm not sure yet -- but I'm definitely not comfortable running things outside of a VM in a production run of Bait.

Retest Button

Builds on the UI should have a retest button that will destroy the sandbox, recreate it, reclone, retest, etc.

Auto-test new builds

This will block sinatra but that's OK for now.

When a build shows up, make it get tested automatically, the focus will now begin shifting towards RubyMotion stuff, but for now lets get it to test itself in this way.

Coverage Report Display

If a project has simplecov installed, a coverage/ directory will be present.
Rather than work on static analysis next, let's add simplecov support.
This will sufficiently present complications on the UI that need thought before we do static analysis.

After test, check if there was a coverage/index.html created in the sandbox
If so, set Build's boolean simplecov to true and set the URL
Publish that simplecov is available along with the URL so a button is rendered for hitting the URL

Improve User Interface

  • look good on mobile devices
  • improve general design
  • show commit message and sha1
  • rename ref to branch and show it noiseless on 1 line ("Show more..." button)
  • Add date
  • Fix ugly log output

Standalone gem is broken

minivan:~ (master) $ gem install bait
Fetching: bait-0.2.0.gem (100%)
Successfully installed bait-0.2.0
Parsing documentation for bait-0.2.0
Installing ri documentation for bait-0.2.0
1 gem installed
minivan:~ (master) $ bait
/Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler/shared_helpers.rb:22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:231:in `default_gemfile'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:177:in `root'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:99:in `bundle_path'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:363:in `configure_gem_home_and_path'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:90:in `configure'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:146:in `definition'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0/gems/bait-0.2.0/config/boot.rb:5:in `<top (required)>'
    from /Users/keyvan/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in `require'
    from /Users/keyvan/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0/gems/bait-0.2.0/bin/bait:3:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0/bin/bait:23:in `load'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0/bin/bait:23:in `<main>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'
minivan:~ (master) $

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.