summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-10-13 14:14:00 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2014-10-13 14:14:00 +0100
commitb7de175d185948c1130a1036ecd11d113dbf1175 (patch)
treea91a6eb549b979ed3c3c4d1636e74ea9df1b3f2b
parent62fa7e08f76a5b6bb8410add49c40656b3e73acd (diff)
parentfc7a260f8f5a40db59674ed2688b7001d30cd80a (diff)
downloadcmdtest-b7de175d185948c1130a1036ecd11d113dbf1175.tar.gz
Merge branch 'baserock/richardmaw/space-efficient' into baserock/morph
This extends the temporary fork of yarn further, so that it can be demonstrated that the changes are being used. Reviewed-by: Richard Ipsum Reviewed-by: Sam Thursfield
-rw-r--r--NEWS12
-rw-r--r--README5
-rw-r--r--cmdtestlib.py2
-rw-r--r--debian/changelog21
-rw-r--r--debian/control4
-rwxr-xr-xyarn19
-rwxr-xr-xyarn.tests/warn-if-missing-step.script10
7 files changed, 62 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 5c99718..9c3eb04 100644
--- a/NEWS
+++ b/NEWS
@@ -3,13 +3,21 @@ NEWS for cmdtest
This file summarizes changes between releases of cmdtest.
-Version 0.11, released UNRELEASED
+Version 0.12, released 2014-03-28
+---------------------------------
+
+For yarn:
+
+* Do not fail a test suite if snapshotting `DATADIR` fails.
+
+Version 0.11, released 2014-03-15
---------------------------------
For yarn:
* Report number of scenarios skipped due to an ASSUMING step failing.
- * Fix the error message for reporting scenarios without THEN steps
+
+* Fix the error message for reporting scenarios without THEN steps
to include the names of those scenarios only, rather than all
scenarios. Patch by Pete Fotheringham.
diff --git a/README b/README
index b83eabc..3714e84 100644
--- a/README
+++ b/README
@@ -15,6 +15,11 @@ If not, it reports problems, and shows the differences.
See the manual page for details on how to use the program.
+`cmdtest` is now in maintenance mode. I do not expect to add any new
+features, but I will fix bugs. `yarn` is now the preferred tool, as it
+seems to actually fit better the kinds of testing I and others have
+been trying to do with `cmdtest`.
+
yarn
----
diff --git a/cmdtestlib.py b/cmdtestlib.py
index 66cb9e9..5d50002 100644
--- a/cmdtestlib.py
+++ b/cmdtestlib.py
@@ -14,7 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-__version__ = '0.10'
+__version__ = '0.12'
import os
diff --git a/debian/changelog b/debian/changelog
index 2bd069f..92f3bf5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
+cmdtest (0.13-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+ * debian/control: Update Standards-Version to 3.9.5. No other
+ changes needed.
+ * debian/control: Move Homepage: to source stanza.
+
+ -- Lars Wirzenius <liw@liw.fi> Sat, 29 Mar 2014 12:36:44 +0000
+
+cmdtest (0.12-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Lars Wirzenius <liw@liw.fi> Fri, 28 Mar 2014 07:33:42 +0000
+
+cmdtest (0.11-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Lars Wirzenius <liw@liw.fi> Sat, 15 Mar 2014 10:22:18 +0000
+
cmdtest (0.10-1) unstable; urgency=low
* New upstream release.
diff --git a/debian/control b/debian/control
index 5944b5d..2f7faf0 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,9 @@
Source: cmdtest
Maintainer: Lars Wirzenius <liw@liw.fi>
+Homepage: http://liw.fi/cmdtest/
Section: python
Priority: optional
-Standards-Version: 3.9.3
+Standards-Version: 3.9.5
Build-Depends: debhelper (>= 7.3.8), python-all (>= 2.6.6-3~),
python-cliapp, python-ttystatus, python-markdown
X-Python-Version: >= 2.6
@@ -20,4 +21,3 @@ Description: blackbox testing of Unix command line programs
line programs, and tries to make that as easy as possible.
.
Also included is a "scenario testing" tool, yarn.
-Homepage: http://liw.fi/cmdtest/
diff --git a/yarn b/yarn
index 6dc09c5..ffec41a 100755
--- a/yarn
+++ b/yarn
@@ -55,8 +55,8 @@ class YarnRunner(cliapp.Application):
self.settings.string_list(
['run', 'r'],
- 'run only TEST (this option can be repeated)',
- metavar='TEST')
+ 'run only SCENARIO (this option can be repeated)',
+ metavar='SCENARIO')
self.settings.string(
['tempdir'],
@@ -156,7 +156,7 @@ class YarnRunner(cliapp.Application):
duration = time.time() - start_time
if not self.settings['snapshot']:
- shutil.rmtree(self.tempdir)
+ shutil.rmtree(self.tempdir, ignore_errors=True)
if not self.settings['quiet']:
self.ts.clear()
@@ -260,6 +260,9 @@ class YarnRunner(cliapp.Application):
ok = scenario_runner.run_scenario(scenario, datadir, homedir)
self.remember_scenario_timing(time.time() - started)
+
+ if not self.settings['snapshot']:
+ shutil.rmtree(datadir, ignore_errors=True)
return ok
def homedir(self, datadir):
@@ -314,8 +317,9 @@ class YarnRunner(cliapp.Application):
self.indent(stdout), self.indent(stderr)))
self.remember_step_timing(
'%s %s' % (step.what, step.text), stopped - started)
- self.snapshot_datadir(self.tempdir, step_env['DATADIR'],
- scenario, step_number, step)
+ if self.settings['snapshot']:
+ self.snapshot_datadir(self.tempdir, step_env['DATADIR'],
+ scenario, step_number, step)
def scenario_dir(self, tempdir, scenario):
return os.path.join(tempdir, self.nice(scenario.name))
@@ -331,7 +335,10 @@ class YarnRunner(cliapp.Application):
def snapshot_datadir(self, tempdir, datadir, scenario, step_number, step):
snapshot = self.snapshot_dir(tempdir, scenario, step, step_number)
- cliapp.runcmd(['cp', '-a', datadir, snapshot])
+ exit, out, err = cliapp.runcmd_unchecked(
+ ['cp', '-ax', datadir, snapshot])
+ if exit != 0:
+ logging.warning('Snapshot copy failed:\n%s\n%s' % (out, err))
def nice(self, name):
# Quote a scenario or step name so it forms a nice filename.
diff --git a/yarn.tests/warn-if-missing-step.script b/yarn.tests/warn-if-missing-step.script
new file mode 100755
index 0000000..c1ec4af
--- /dev/null
+++ b/yarn.tests/warn-if-missing-step.script
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -eu
+
+cat <<EOF > "$DATADIR/missing-step.yarn"
+ SCENARIO missing step
+ THEN missing step
+EOF
+
+./run-yarn --allow-missing-step "$DATADIR/missing-step.yarn"