Skip to content

Instantly share code, notes, and snippets.

dave-shawley

Block or report user

Report or block dave-shawley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dave-shawley on github.
  • I am daveshawley (https://keybase.io/daveshawley) on keybase.
  • I have a public key whose fingerprint is E1B6 B144 A6D1 51F9 DD04 EFDA 2748 E69F 7CB1 DB19

To claim this, I am signing this object:

@dave-shawley
dave-shawley / service_functionality.bats
Created Nov 17, 2013
BATS integration tests for nginx proxy
View service_functionality.bats
@test "nginx proxies to devpi-server" {
HOST=$(hostname --fqdn)
TMPFILE=$BATS_TMPDIR/root-pypi
wget -q -O$TMPFILE http://$HOST/root/pypi
grep 'type.*"indexconfig"' $TMPFILE
grep 'type.*"mirror"' $TMPFILE
}
@dave-shawley
dave-shawley / devpi-server
Last active Dec 28, 2015
nginx configuration for devpi-server
View devpi-server
#
# nginx proxy for devpi-server
#
upstream devpi {
server 127.0.0.1:3141;
}
server {
server_name <%= node.fqdn %>;
@dave-shawley
dave-shawley / service_configuration.bats
Created Nov 17, 2013
BATS integration tests for nginx
View service_configuration.bats
@test "devpi-server is enabled" {
test -e /etc/nginx/sites-available/devpi-server
test -L /etc/nginx/sites-enabled/devpi-server
}
@dave-shawley
dave-shawley / service_installation.bats
Last active Dec 28, 2015
BATS integration tests for an nginx recipe
View service_installation.bats
@test "nginx is installed" {
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
test -n "$(which nginx)"
}
@test "default site is disabled" {
test ! -e /etc/nginx/sites-enabled/default
}
@dave-shawley
dave-shawley / gist:5013968
Created Feb 22, 2013
Little helper function that runs a bunch of named tests back-to-back calling setUp() and tearDown() methods. Very useful for spot checking unit test coverage in Eclipse but not nearly general purpose.
View gist:5013968
private void runTestsNamed(String... testNames) throws Exception {
for (int i=0; i<testNames.length; ++i) {
Method testCase = this.getClass().getMethod(testNames[i]);
testCase.invoke(this);
if ((i + 1) < testNames.length) {
tearDown();
setUp();
}
}
}
You can’t perform that action at this time.