Skip to content
This repository has been archived by the owner. It is now read-only.
Cloud Foundry library for maintaining on-premises buildpacks
Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib Require tempfile when needed Sep 7, 2017
scripts Use space integration for default Feb 13, 2017
spec
.gitignore Add integration spec generated Dockerfile* to .gitignore Apr 6, 2016
.rspec optionally accept database name of DATABASE_URL Jun 6, 2014
.rubocop.yml add Rubocop Jan 29, 2016
Gemfile
LICENSE Correct LICENSE appendix Jul 8, 2016
NOTICE Correct copyright NOTICE Dec 21, 2016
README.md Improving the README by adding couple of usages. Sep 6, 2017
Rakefile
machete.gemspec

README.md

Machete

Machete is the CF buildpack test framework.

Prerequisites

Cloud Foundry

The tests require a running instance of Cloud Foundry. By default, it will try to find an instance at the local IP 10.244.0.34. You can specify an alternative Cloud Foundry instance with the --host argument.

Usage :

bundle exec buildpack-build --host=myhost.mydomain

We run our tests with a local bosh-lite deployment. See the github repo for more instructions.

These tests assume an org named pivotal and a space named integration exist. Use these commands to create them:

cf create-org pivotal
cf create-space integration -o pivotal

Usage

  1. Navigate to the buildpack that you want to test (e.g., Ruby Buildpack)
  2. Update submodules:
git  submodule update --init
  1. From your buildpack's directory, run the buildpack-build script.
bundle exec buildpack-build

Buildpack Modes:

  • uncached: Buildpack dependencies will be fetched from the internet when staging an app.
  • cached : Buildpack dependencies will be downloaded and bundled with the buildpack before uploading it to Cloud Foundry.

If you only want to run your tests with one mode, you can use the bundle exec buildpack-build [ --cached | --uncached ] script instead.

Logging

Errors in the Machete library log to STDOUT by default. You can change Machete's default log:

  Machete.logger = Machete::Logger.new("log/integration.log")

Running Test Suite

To run the unit test suite, run the following from the base machete directory:

$ rspec

To run the integration test, run the following from the internet_traffic_test directory:

$ cf_exec buildpack-build

Notes

RVM Version

You may encounter a silent early exit for scripts cached-build and uncached-build. This is an issue with RVM running inside a bash script with set -e.

Ensure you have the latest stable version of RVM

$ rvm --version # At least version 1.25.22
You can’t perform that action at this time.