[PATCH] tests: add Vagrantfile to automate running them on virtual machines

anatoly techtonik techtonik at gmail.com
Sat Jul 5 11:42:55 CDT 2014


# HG changeset patch
# User anatoly techtonik <techtonik at gmail.com>
# Date 1404567148 -10800
#      Sat Jul 05 16:32:28 2014 +0300
# Branch stable
# Node ID 65a3d892ee2f147d536ffc5a0af84432fc18eb48
# Parent  2392b9e1936628faeec818368169a68b1fadd95f
tests: add Vagrantfile to automate running them on virtual machines

Now running tests is as easy as:
1. install vagrant
2. $ vagrant up
3. $ vagrant ssh -c ./run-tests

diff -r 2392b9e19366 -r 65a3d892ee2f Vagrantfile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Vagrantfile	Sat Jul 05 16:32:28 2014 +0300
@@ -0,0 +1,18 @@
+# -*- mode: ruby -*-
+
+# Usage:
+#
+# $ vagrant up
+# $ vagrant ssh -c ./run-tests
+
+Vagrant.configure('2') do |config|
+  # Debian 7.4 32-bit i386 without configuration management software
+  config.vm.box = "puppetlabs/debian-7.4-32-nocm"
+  #config.vm.box = "pnd/debian-wheezy32-basebox"
+  config.vm.hostname = "tests"
+
+  config.vm.define "tests" do |conf|
+    conf.vm.provision :file, source: "contrib/test.run-tests", destination:"run-tests"
+    conf.vm.provision :shell, path: "contrib/test.provision"
+  end
+end
diff -r 2392b9e19366 -r 65a3d892ee2f contrib/test.provision
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/test.provision	Sat Jul 05 16:32:28 2014 +0300
@@ -0,0 +1,10 @@
+#!/bin/sh
+# This scripts is used to install dependencies for
+# testing Mercurial. Mainly used by Vagrant (see
+# Vagrantfile for details).
+
+export DEBIAN_FRONTEND=noninteractive
+apt-get update
+apt-get install -y -q python-dev unzip
+# run-tests is added by Vagrantfile
+chmod +x run-tests
diff -r 2392b9e19366 -r 65a3d892ee2f contrib/test.run-tests
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/test.run-tests	Sat Jul 05 16:32:28 2014 +0300
@@ -0,0 +1,12 @@
+#!/bin/sh
+# This scripts is used to setup temp directory in memory
+# for running Mercurial tests in vritual machine managed
+# by Vagrant (see Vagrantfile for details).
+
+cd /vagrant
+make local
+cd tests
+mkdir /tmp/ram
+sudo mount -t tmpfs -o size=100M tmpfs /tmp/ram
+./run-tests.py -l --tmpdir=/tmp/ram/delme --time
+


More information about the Mercurial-devel mailing list