From 1403da9db51083aa2686d83b68075a85d7f2dfa4 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 6 Feb 2014 15:50:47 +0000 Subject: elements: remove unused execute method --- yarnlib/elements.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/yarnlib/elements.py b/yarnlib/elements.py index 9eeb1b7..f6a5300 100644 --- a/yarnlib/elements.py +++ b/yarnlib/elements.py @@ -44,8 +44,3 @@ class Implementation(object): self.regexp = regexp self.shell = shell - def execute(self): - exit, out, err = cliapp.runcmd_unchecked( - ['sh', '-c', 'set -eu\n' + self.shell]) - return exit - -- cgit v1.2.1 From 344a817463684b6388aa79ee8234d58dc40b1f10 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 27 Feb 2014 21:37:54 +0000 Subject: When snapshotting datadir, don't cross mounts This should fix problems with snapshotting datadir when there is a FUSE mount in there, for example. --- yarn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn b/yarn index af25d21..f2b48b5 100755 --- a/yarn +++ b/yarn @@ -454,7 +454,7 @@ 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]) + cliapp.runcmd(['cp', '-ax', datadir, snapshot]) def nice(self, name): # Quote a scenario or step name so it forms a nice filename. -- cgit v1.2.1 From a387bfc55e4d90662b5ecc1e64cadf2598ea3e15 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 10 Mar 2014 18:48:14 +0000 Subject: Fix doc for --run to speak of scenarios --- yarn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn b/yarn index f2b48b5..bb62493 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'], -- cgit v1.2.1 From aa76577e4e674ffabcad8bce9d3d8497d7ae073a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 15 Mar 2014 10:18:18 +0000 Subject: Add test for yarn for a missing step --- yarn.tests/warn-if-missing-step.script | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 yarn.tests/warn-if-missing-step.script 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 < "$DATADIR/missing-step.yarn" + SCENARIO missing step + THEN missing step +EOF + +./run-yarn --allow-missing-step "$DATADIR/missing-step.yarn" -- cgit v1.2.1 From ba573bae800e2f4950c01f517eeeb5fe05f78e19 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 15 Mar 2014 10:22:40 +0000 Subject: Prepare release 0.11 --- NEWS | 5 +++-- cmdtestlib.py | 2 +- debian/changelog | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 5c99718..335c679 100644 --- a/NEWS +++ b/NEWS @@ -3,13 +3,14 @@ NEWS for cmdtest This file summarizes changes between releases of cmdtest. -Version 0.11, released UNRELEASED +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/cmdtestlib.py b/cmdtestlib.py index 66cb9e9..0bf650c 100644 --- a/cmdtestlib.py +++ b/cmdtestlib.py @@ -14,7 +14,7 @@ # along with this program. If not, see . -__version__ = '0.10' +__version__ = '0.11' import os diff --git a/debian/changelog b/debian/changelog index 2bd069f..9511090 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cmdtest (0.11-1) unstable; urgency=low + + * New upstream release. + + -- Lars Wirzenius Sat, 15 Mar 2014 10:22:18 +0000 + cmdtest (0.10-1) unstable; urgency=low * New upstream release. -- cgit v1.2.1 From ed1c176dd2b45f7f3255d2bbfd1deeda5912c355 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 27 Mar 2014 20:23:38 +0000 Subject: Stop yarn from failing test if snapshot fails --- NEWS | 7 +++++++ yarn | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 335c679..57e12f2 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,13 @@ NEWS for cmdtest This file summarizes changes between releases of cmdtest. +Version 0.12, released UNRELEASED +--------------------------------- + +For yarn: + +* Do not fail a test suite if snapshotting `DATADIR` fails. + Version 0.11, released 2014-03-15 --------------------------------- diff --git a/yarn b/yarn index bb62493..c34ccbb 100755 --- a/yarn +++ b/yarn @@ -454,7 +454,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', '-ax', 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. -- cgit v1.2.1 From 811b19e5eef5be34d30d8a9724800e12ebe6e233 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 27 Mar 2014 20:43:55 +0000 Subject: Ignore errors when removing DATADIR as well --- yarn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn b/yarn index c34ccbb..0896f8d 100755 --- a/yarn +++ b/yarn @@ -351,7 +351,7 @@ class YarnRunner(cliapp.Application): break if not self.settings['snapshot']: - shutil.rmtree(tempdir) + shutil.rmtree(tempdir, ignore_errors=True) self.remember_scenario_timing(time.time() - started) return ok -- cgit v1.2.1 From 64a0d72f3b5980ad30a38b3c34929836a4c0cfea Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 28 Mar 2014 07:34:34 +0000 Subject: Prepare release version 0.12 --- NEWS | 2 +- cmdtestlib.py | 2 +- debian/changelog | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 57e12f2..9c3eb04 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ NEWS for cmdtest This file summarizes changes between releases of cmdtest. -Version 0.12, released UNRELEASED +Version 0.12, released 2014-03-28 --------------------------------- For yarn: diff --git a/cmdtestlib.py b/cmdtestlib.py index 0bf650c..5d50002 100644 --- a/cmdtestlib.py +++ b/cmdtestlib.py @@ -14,7 +14,7 @@ # along with this program. If not, see . -__version__ = '0.11' +__version__ = '0.12' import os diff --git a/debian/changelog b/debian/changelog index 9511090..62117e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cmdtest (0.12-1) unstable; urgency=low + + * New upstream release. + + -- Lars Wirzenius Fri, 28 Mar 2014 07:33:42 +0000 + cmdtest (0.11-1) unstable; urgency=low * New upstream release. -- cgit v1.2.1 From bdf5a8d93f951c3cf15cef5822e6619d50a38803 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 29 Mar 2014 12:38:20 +0000 Subject: Tweak debian/control --- debian/changelog | 9 +++++++++ debian/control | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 62117e4..92f3bf5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +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 Sat, 29 Mar 2014 12:36:44 +0000 + cmdtest (0.12-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 +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/ -- cgit v1.2.1 From acd3d6316ef5831be1a9663a267b485767ada418 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 26 Aug 2014 19:01:56 +0100 Subject: Document in README that cmdtest is in maint mode --- README | 5 +++++ 1 file changed, 5 insertions(+) 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 ---- -- cgit v1.2.1 From 634a589643e2a8a56feb9c31fba789702387c1b3 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sat, 11 Oct 2014 15:31:19 +0000 Subject: yarn: Don't snapshot datadir without --snapshot It would previously create the snapshots, then remove them again after all the scenarios have been run. This is unhelpful if you're running tests in a tmpfs, and you've got non-trivial amounts of data in DATADIR. --- yarn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yarn b/yarn index 923ceb9..15b171c 100755 --- a/yarn +++ b/yarn @@ -314,8 +314,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)) -- cgit v1.2.1 From fc7a260f8f5a40db59674ed2688b7001d30cd80a Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sat, 11 Oct 2014 15:54:14 +0000 Subject: yarn: Remove scenario DATADIR after running Now it will remove the DATADIR of the scenario after it has run, rather than after every scenario has been run, if --snapshot has not been specified. This reduces the amount of space needed to run yarn tests further. --- yarn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yarn b/yarn index 15b171c..ffec41a 100755 --- a/yarn +++ b/yarn @@ -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): -- cgit v1.2.1