Permalink
Browse files

First version of the rails test box. Not working yet. Pushed for review

  • Loading branch information...
0 parents commit e1add102e900deee21b279b5ce6b19152a58d1e2 @jeroenvandijk committed Mar 15, 2010
Showing with 3,430 additions and 0 deletions.
  1. +21 −0 .gitignore
  2. +3 −0 .gitmodules
  3. +1 −0 .vagrant
  4. +44 −0 README.mdown
  5. +21 −0 Vagrantfile
  6. +9 −0 cookbooks/apt/files/default/apt-cacher
  7. +144 −0 cookbooks/apt/files/default/apt-cacher.conf
  8. +50 −0 cookbooks/apt/files/default/apt-proxy-v2.conf
  9. +37 −0 cookbooks/apt/metadata.json
  10. +11 −0 cookbooks/apt/metadata.rb
  11. +42 −0 cookbooks/apt/recipes/cacher.rb
  12. +33 −0 cookbooks/apt/recipes/default.rb
  13. +34 −0 cookbooks/apt/recipes/proxy.rb
  14. +38 −0 cookbooks/build-essential/metadata.json
  15. +9 −0 cookbooks/build-essential/metadata.rb
  16. +43 −0 cookbooks/build-essential/recipes/default.rb
  17. +1 −0 cookbooks/curl/recipes/default.rb
  18. +37 −0 cookbooks/git/README.rdoc
  19. +42 −0 cookbooks/git/metadata.json
  20. +15 −0 cookbooks/git/metadata.rb
  21. +26 −0 cookbooks/git/recipes/default.rb
  22. +28 −0 cookbooks/git/recipes/server.rb
  23. +2 −0 cookbooks/git/templates/default/sv-git-daemon-log-run.erb
  24. +3 −0 cookbooks/git/templates/default/sv-git-daemon-run.erb
  25. +29 −0 cookbooks/java/README.rdoc
  26. +11 −0 cookbooks/java/files/default/java.seed
  27. +35 −0 cookbooks/java/metadata.json
  28. +10 −0 cookbooks/java/metadata.rb
  29. +46 −0 cookbooks/java/recipes/default.rb
  30. +95 −0 cookbooks/mysql/README.rdoc
  31. +42 −0 cookbooks/mysql/attributes/server.rb
  32. +15 −0 cookbooks/mysql/libraries/database.rb
  33. +214 −0 cookbooks/mysql/metadata.json
  34. +73 −0 cookbooks/mysql/metadata.rb
  35. +13 −0 cookbooks/mysql/providers/database.rb
  36. +50 −0 cookbooks/mysql/recipes/client.rb
  37. +20 −0 cookbooks/mysql/recipes/default.rb
  38. +82 −0 cookbooks/mysql/recipes/server.rb
  39. +49 −0 cookbooks/mysql/recipes/server_ec2.rb
  40. +5 −0 cookbooks/mysql/resources/database.rb
  41. +12 −0 cookbooks/mysql/templates/centos/my.cnf.erb
  42. +11 −0 cookbooks/mysql/templates/default/debian.cnf.erb
  43. +12 −0 cookbooks/mysql/templates/default/grants.sql.erb
  44. +163 −0 cookbooks/mysql/templates/default/my.cnf.erb
  45. +10 −0 cookbooks/mysql/templates/default/mysql-server.seed.erb
  46. +3 −0 cookbooks/mysql/templates/default/port_mysql.erb
  47. +12 −0 cookbooks/mysql/templates/redhat/my.cnf.erb
  48. +156 −0 cookbooks/mysql/templates/ubuntu-8.04/my.cnf.erb
  49. +158 −0 cookbooks/mysql/templates/ubuntu-9.10/my.cnf.erb
  50. +33 −0 cookbooks/openssl/README.rdoc
  51. +37 −0 cookbooks/openssl/libraries/secure_password.rb
  52. +29 −0 cookbooks/openssl/metadata.json
  53. +6 −0 cookbooks/openssl/metadata.rb
  54. +19 −0 cookbooks/openssl/recipes/default.rb
  55. +45 −0 cookbooks/postgresql/README.rdoc
  56. +27 −0 cookbooks/postgresql/attributes/postgresql.rb
  57. +57 −0 cookbooks/postgresql/metadata.json
  58. +18 −0 cookbooks/postgresql/metadata.rb
  59. +25 −0 cookbooks/postgresql/recipes/client.rb
  60. +18 −0 cookbooks/postgresql/recipes/default.rb
  61. +22 −0 cookbooks/postgresql/recipes/dev.rb
  62. +47 −0 cookbooks/postgresql/recipes/server.rb
  63. +83 −0 cookbooks/postgresql/templates/default/pg_hba.conf.erb
  64. +493 −0 cookbooks/postgresql/templates/default/postgresql.conf.erb
  65. +3 −0 cookbooks/rails_test_suite/files/default/rails_mysql_user_grants.sql
  66. +52 −0 cookbooks/rails_test_suite/recipes/default.rb
  67. +44 −0 cookbooks/ruby/metadata.json
  68. +9 −0 cookbooks/ruby/metadata.rb
  69. +49 −0 cookbooks/ruby/recipes/default.rb
  70. +30 −0 cookbooks/rubygems/metadata.json
  71. +9 −0 cookbooks/rubygems/metadata.rb
  72. +25 −0 cookbooks/rubygems/recipes/default.rb
  73. +1 −0 cookbooks/rvm/files/default/bash_profile
  74. +42 −0 cookbooks/rvm/recipes/default.rb
  75. +35 −0 cookbooks/sqlite/metadata.json
  76. +9 −0 cookbooks/sqlite/metadata.rb
  77. +26 −0 cookbooks/sqlite/recipes/default.rb
  78. +21 −0 cookbooks/sqlite/recipes/dev.rb
  79. +14 −0 cookbooks/vagrant_main/recipes/default.rb
  80. +47 −0 cookbooks/zlib/metadata.json
  81. +9 −0 cookbooks/zlib/metadata.rb
  82. +25 −0 cookbooks/zlib/recipes/default.rb
  83. +1 −0 rails
@@ -0,0 +1,21 @@
+*.gem
+pkg
+.bundle
+debug.log
+doc/rdoc
+activemodel/doc
+activeresource/doc
+activerecord/doc
+actionpack/doc
+actionmailer/doc
+activesupport/doc
+activemodel/test/fixtures/fixture_database.sqlite3
+actionpack/test/tmp
+activesupport/test/fixtures/isolation_test
+railties/test/500.html
+railties/test/fixtures/tmp
+railties/test/initializer/root/log
+railties/doc/guides/html/images
+railties/doc/guides/html/stylesheets
+railties/guides/output
+railties/tmp
@@ -0,0 +1,3 @@
+[submodule "rails"]
+ path = rails
+ url = git://github.com/rails/rails.git
@@ -0,0 +1 @@
+f3a7311c-4641-4734-aa7e-c7d8e85eb7b2
@@ -0,0 +1,44 @@
+Currently this repository is not working fully, do not use it yet
+It assumes you have vagrant installed from the github repository,
+
+Issues:
+
+ - rake mysql:build_databases makes the vagrant script fail
+ - When you ssh into the box and run the test it will tell you that gems have not been installed while bundler has been run
+
+
+
+
+
+Rails Test Box (Still an Idea in progress)
+==============
+
+This repositories contains everything you need to be a Rails Core contributor in no-time
+
+After you have ran through the instruction below you'll be able to run the Rails Test Suite (for the most important databases).
+
+Install VirtualBox
+
+ gem install vagrant
+
+Clone this repository
+
+ git clone
+ git submodules init
+ cd rails_test_box
+ vagrant up
+
+Wait a while until you vagrant is ready
+
+ vagrant ssh
+ cd rails
+ rake
+
+Everything should pass. Now you can start patching Rails and run the tests again.
+
+
+TODO
+----
+Add memcache support
+Find out why not all tests are succeeding
+Add commands to run test suite from the host dir
@@ -0,0 +1,21 @@
+Vagrant::Config.run do |config|
+ # All Vagrant configuration is done here. For a detailed explanation
+ # and listing of configuration options, please check the documentation
+ # online.
+
+ # Every Vagrant virtual environment requires a box to build off of.
+ config.vm.box = "base"
+ # config.vm.project_directory = "/home/vagrant/rails"
+ # config.ssh.username = "root"
+
+ config.vm.share_folder('rails', 'rails', 'rails')
+
+ config.vm.provisioner = :chef_solo
+ config.chef.cookbooks_path = "cookbooks"
+ config.chef.json.merge!({
+ :mysql => {
+ :server_root_password => "root"
+ }
+ })
+
+end
@@ -0,0 +1,9 @@
+# apt-cacher startup configuration file
+
+# IMPORTANT: check the apt-cacher.conf file before using apt-cacher as daemon.
+
+# set to 1 to start the daemon at boot time
+AUTOSTART=1
+
+# extra settings to override the ones in apt-cacher.conf
+# EXTRAOPT=" daemon_port=3142 limit=30 "
@@ -0,0 +1,144 @@
+# This file has been modified by ./apt-proxy-to-apt-cacher
+# Some lines may have been appended at the bottom of this file
+# This file has been modified by /usr/share/apt-cacher/apt-proxy-to-apt-cacher
+# Some lines may have been appended at the bottom of this file
+#################################################################
+# This is the config file for apt-cacher. On most Debian systems
+# you can safely leave the defaults alone.
+#################################################################
+
+# cache_dir is used to set the location of the local cache. This can
+# become quite large, so make sure it is somewhere with plenty of space.
+cache_dir=/var/cache/apt-cacher
+
+# The email address of the administrator is displayed in the info page
+# and traffic reports.
+admin_email=root@localhost
+
+# For the daemon startup settings please edit the file /etc/default/apt-cacher.
+
+# Daemon port setting, only useful in stand-alone mode. You need to run the
+# daemon as root to use privileged ports (<1024).
+daemon_port = 3142
+
+# optional settings, user and group to run the daemon as. Make sure they have
+# sufficient permissions on the cache and log directories. Comment the settings
+# to run apt-cacher as the native user.
+group=www-data
+user=www-data
+
+# optional setting, binds the listening daemon to one specified IP. Use IP
+# ranges for more advanced configuration, see below.
+# daemon_addr=localhost
+
+# If your apt-cacher machine is directly exposed to the Internet and you are
+# worried about unauthorised machines fetching packages through it, you can
+# specify a list of IPv4 addresses which are allowed to use it and another
+# list of IPv4 addresses which aren't.
+# Localhost (127.0.0.1) is always allowed. Other addresses must be matched
+# by allowed_hosts and not by denied_hosts to be permitted to use the cache.
+# Setting allowed_hosts to "*" means "allow all".
+# Otherwise the format is a comma-separated list containing addresses,
+# optionally with masks (like 10.0.0.0/22), or ranges of addresses (two
+# addresses separated by a hyphen, no masks, like '192.168.0.3-192.168.0.56').
+allowed_hosts=*
+denied_hosts=
+
+# And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
+# Note that IPv4-mapped IPv6 addresses (::ffff:w.x.y.z) are truncated to
+# w.x.y.z and are handled as IPv4.
+allowed_hosts_6=fec0::/16
+denied_hosts_6=
+
+# This thing can be done by Apache but is much simplier here - limit access to
+# Debian mirrors based on server names in the URLs
+#allowed_locations=ftp.uni-kl.de,ftp.nerim.net,debian.tu-bs.de
+
+# Apt-cacher can generate usage reports every 24 hours if you set this
+# directive to 1. You can view the reports in a web browser by pointing
+# to your cache machine with '/apt-cacher/report' on the end, like this:
+# http://yourcache.example.com/apt-cacher/report
+# Generating reports is very fast even with many thousands of logfile
+# lines, so you can safely turn this on without creating much
+# additional system load.
+generate_reports=1
+
+# Apt-cacher can clean up its cache directory every 24 hours if you set
+# this directive to 1. Cleaning the cache can take some time to run
+# (generally in the order of a few minutes) and removes all package
+# files that are not mentioned in any existing 'Packages' lists. This
+# has the effect of deleting packages that have been superseded by an
+# updated 'Packages' list.
+clean_cache=1
+
+# The directory to use for apt-cacher access and error logs.
+# The access log records every request in the format:
+# date-time|client ip address|HIT/MISS/EXPIRED|object size|object name
+# The error log is slightly more free-form, and is also used for debug
+# messages if debug mode is turned on.
+# Note that the old 'logfile' and 'errorfile' directives are
+# deprecated: if you set them explicitly they will be honoured, but it's
+# better to just get rid of them from old config files.
+logdir=/var/log/apt-cacher
+
+# apt-cacher can use different methods to decide whether package lists need to
+# be updated,
+# A) looking at the age of the cached files
+# B) getting HTTP header from server and comparing that with cached data. This
+# method is more reliable and avoids desynchronisation of data and index files
+# but needs to transfer few bytes from the server every time somebody requests
+# the files ("apt-get update")
+# Set the following value to the maximum age (in hours) for method A or to 0
+# for method B
+expire_hours=0
+
+# Apt-cacher can pass all its requests to an external http proxy like
+# Squid, which could be very useful if you are using an ISP that blocks
+# port 80 and requires all web traffic to go through its proxy. The
+# format is 'hostname:port', eg: 'proxy.example.com:8080'.
+http_proxy=proxy.example.com:8080
+
+# Use of an external proxy can be turned on or off with this flag.
+# Value should be either 0 (off) or 1 (on).
+use_proxy=0
+
+# External http proxy sometimes need authentication to get full access. The
+# format is 'username:password'.
+http_proxy_auth=proxyuser:proxypass
+
+# Use of external proxy authentication can be turned on or off with this flag.
+# Value should be either 0 (off) or 1 (on).
+use_proxy_auth=0
+
+# Rate limiting sets the maximum bandwidth in bytes per second to use
+# for fetching packages. Syntax is fully defined in 'man wget'.
+# Use 'k' or 'm' to use kilobits or megabits / second: eg, 'limit=25k'.
+# Use 0 or a negative value for no rate limiting.
+limit=0
+
+# Debug mode makes apt-cacher spew a lot of extra debug junk to the
+# error log (whose location is defined with the 'logdir' directive).
+# Leave this off unless you need it, or your error log will get very
+# big. Acceptable values are 0 or 1.
+debug=0
+
+# Adapt the line in the usage info web page to match your server configuration
+# example_sources_line=deb&nbsp;http://<b>my.cacher.server:3142/</b>ftp.au.debian.org/debian&nbsp;unstable&nbsp;main&nbsp;contrib&nbsp;non-free
+
+# Print a 410 (Gone) HTTP message with the specified text when accessed via
+# CGI. Useful to tell users to adapt their sources.list files when the
+# apt-cacher server is beeing relocated (via apt-get's error messages while
+# running "update")
+#cgi_advise_to_use = Please use http://cacheserver:3142/ as apt-cacher access URL
+#cgi_advise_to_use = Server relocated. To change sources.list, run perl -pe "s,/apt-cacher\??,:3142," -i /etc/apt/sources.list
+
+# Server mapping - this allows to hide real server names behind virtual paths
+# that appear in the access URL. This method is known from apt-proxy. This is
+# also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons
+# path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
+# Note that you need to specify all target servers in the allowed_locations
+# options if you make use of it. Also note that the paths should not overlap
+# each other. FTP access method not supported yet, maybe in the future.
+
+# extra setting from apt-proxy configuration
+path_map = ubuntu us.archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; debian debian.osuosl.org/debian/ ; security security.debian.org/debian-security
@@ -0,0 +1,50 @@
+[DEFAULT]
+;; All times are in seconds, but you can add a suffix
+;; for minutes(m), hours(h) or days(d)
+
+;; commented out address so apt-proxy will listen on all IPs
+;; address = 127.0.0.1
+port = 9999
+cache_dir = /var/cache/apt-proxy
+
+;; Control files (Packages/Sources/Contents) refresh rate
+min_refresh_delay = 1s
+complete_clientless_downloads = 1
+
+;; Debugging settings.
+debug = all:4 db:0
+
+time = 30
+passive_ftp = on
+
+;;--------------------------------------------------------------
+;; Cache housekeeping
+
+cleanup_freq = 1d
+max_age = 120d
+max_versions = 3
+
+;;---------------------------------------------------------------
+;; Backend servers
+;;
+;; Place each server in its own [section]
+
+[ubuntu]
+; Ubuntu archive
+backends =
+ http://us.archive.ubuntu.com/ubuntu
+
+[ubuntu-security]
+; Ubuntu security updates
+backends = http://security.ubuntu.com/ubuntu
+
+[debian]
+;; Backend servers, in order of preference
+backends =
+ http://debian.osuosl.org/debian/
+
+[security]
+;; Debian security archive
+backends =
+ http://security.debian.org/debian-security
+ http://ftp2.de.debian.org/debian-security
@@ -0,0 +1,37 @@
+{
+ "dependencies": {
+ },
+ "replacing": {
+ },
+ "description": "Configures apt and apt services",
+ "groupings": {
+ },
+ "platforms": {
+ "ubuntu": [
+
+ ],
+ "debian": [
+
+ ]
+ },
+ "version": "0.8.0",
+ "recommendations": {
+ },
+ "name": "apt",
+ "maintainer": "Opscode, Inc.",
+ "long_description": "",
+ "recipes": {
+ "apt::proxy": "Set up an APT proxy",
+ "apt::cacher": "Set up an APT cache"
+ },
+ "suggestions": {
+ },
+ "maintainer_email": "cookbooks@opscode.com",
+ "attributes": {
+ },
+ "conflicting": {
+ },
+ "license": "Apache 2.0",
+ "providing": {
+ }
+ }
@@ -0,0 +1,11 @@
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
+license "Apache 2.0"
+description "Configures apt and apt services"
+version "0.8"
+recipe "apt::cacher", "Set up an APT cache"
+recipe "apt::proxy", "Set up an APT proxy"
+
+%w{ ubuntu debian }.each do |os|
+ supports os
+end
@@ -0,0 +1,42 @@
+#
+# Cookbook Name:: apt
+# Recipe:: cacher
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+package "apt-cacher" do
+ action :install
+end
+
+service "apt-cacher" do
+ supports :restart => true, :status => false
+ action [ :enable, :start ]
+end
+
+remote_file "/etc/apt-cacher/apt-cacher.conf" do
+ source "apt-cacher.conf"
+ owner "root"
+ group "root"
+ mode 0644
+ notifies :restart, resources(:service => "apt-cacher")
+end
+
+remote_file "/etc/default/apt-cacher" do
+ source "apt-cacher"
+ owner "root"
+ group "root"
+ mode 0644
+ notifies :restart, resources(:service => "apt-cacher")
+end
Oops, something went wrong.

0 comments on commit e1add10

Please sign in to comment.