Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fnichol's full-sized avatar

Fletcher Nichol fnichol

View GitHub Profile
@fnichol
fnichol / README.md
Last active August 29, 2015 14:20
Upgrade Test Kitchen to 1.4.0 in an existing ChefDK installation

If you're using ChefDK and find you can't wait for the next release to come out (which will out be shortly), you might want to give the chefdk-update-app project a spin to update test-kitchen (follow the setup instructions in the README).

Upgrade test-kitchen

Upgrade test-kitchen with the following for Unix-based workstations:

sudo -E ./bin/chefdk-update-app.sh test-kitchen -r v1.4.0
@fnichol
fnichol / README.md
Last active August 29, 2015 14:15
Benchmarking Remote CMD and Powershell Invocations with WinRM in Test Kitchen

Benchmarking Remote CMD and Powershell Invocations with WinRM in Test Kitchen

Notes

  • The executor in the code is a CommandExecutor which sets up and reuses a remote shell session across calls and recyles it before the maxiumum commands-per-shell limit is reached.
  • The vanilla object is a regular WinRM::WinRMWebService instance which sets up and tears down a shell for every CMD and Powershell script invocation.
  • The Powershell script variant is really running a powershell -encodedCommand <ENCODED_SCRIPT> over CMD.
  • The file appending operation isn't very taxing on the Windows host but simulates a chunked file upload and so tries to measure the relative cost of command invocations vs. measuring the time for the commands to execute.

Observations

@fnichol
fnichol / ruby-install-prof.sh
Created February 15, 2015 23:00
Build an MRI Ruby version for ruby-prof using ruby-install
# Build an MRI Ruby version ready for ruby-prof (https://github.com/ruby-prof/ruby-prof)
VERSION=2.2.0
ruby-install \
--install-dir ~/.rubies/ruby-prof-$VERSION \
-p https://raw.githubusercontent.com/skaes/rvm-patchsets/master/patches/ruby/$VERSION/railsexpress/01-zero-broken-tests.patch \
-p https://raw.githubusercontent.com/skaes/rvm-patchsets/master/patches/ruby/$VERSION/railsexpress/02-improve-gc-stats.patch \
-p https://raw.githubusercontent.com/skaes/rvm-patchsets/master/patches/ruby/$VERSION/railsexpress/03-display-more-detailed-stack-trace.patch \
-p https://raw.githubusercontent.com/skaes/rvm-patchsets/master/patches/ruby/$VERSION/railsexpress/04-backport-401c8bb.patch \
@fnichol
fnichol / kitchen.yml
Last active June 26, 2019 02:29
Testing multiple versions of Chef with Test Kitchen
---
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: ubuntu-12.04-chef-11
driver:
@fnichol
fnichol / git-buildstep
Created September 5, 2014 17:41
Git Buildstep
#!/usr/bin/env bash
set -e
banner() { echo "-----> $*"; }
warn() { echo ">>>>>> $*"; }
DOCKER="${DOCKER:-docker}"
REF=HEAD
while [[ $# -gt 0 ]] ; do
@fnichol
fnichol / chefdk-ubuntu-12.04.sh
Created June 3, 2014 16:14
ChefDK Installation Scripts
#!/usr/bin/env sh
set -e
if [ -d /opt/chefdk ]; then
echo "ChefDK installed in /opt/chefdk, quitting" >&2
exit 0
fi
url="https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.1.0-1_amd64.deb"
pkg="/tmp/`basename \`echo $url\``"
@fnichol
fnichol / abstract.md
Created April 9, 2014 14:56
ChefConf 2014 Talk: Test Kitchen: One Year Later and the Future

Test Kitchen: One Year Later and the Future

Where

ChefConf 2014 in San Francisco

When

Wednesday, April 16, 2014 at 14:20 (Ballroom A in Future Chef track)

@fnichol
fnichol / unfuck-vmware-net.sh
Created February 13, 2014 19:32
"Fix" VMware Network
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
banner() { printf -- "-----> $*\n"; }
banner "Restarting VMware networking"
banner "Stoping networking"
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
@fnichol
fnichol / README.md
Last active August 6, 2022 20:29
Testing on Mac Platforms with Test Kitchen

Testing Mac Platforms with Test Kitchen

We'll assume an OS X Mavericks (10.9) box here.

Requirements

You'll need:

  • Vagrant
  • Vagrant's VMware Fusion provider
@fnichol
fnichol / README.md
Last active January 20, 2019 13:32
(Excellent?) Format Changes to Test Kitchen's kitchen.yml

Format Changes to Test Kitchen's kitchen.yml File

This is happening thanks to a refactoring of the data manipulation code formerly in Kitchen::Config.

There are now 3 main configuration blocks that can be placed in the various levels:

  • driver: Configurtation relavent to Kitchen drivers. This is a combination of what was driver_plugin and driver_config. Backwards compatability is guarenteed with the legacy formats for a time, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • provisioner: Configuration relating to the automation tool being used. Currently supporting "chef_solo" and "chef_zero". Previously several Chef-related config paths were dumped in a Suite block, namely data_path, data_bags_path, environments_path, nodes_path, roles_path, etc. These will be supported for backwards compatability, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • busser: Configuration rela