From 305f0d8ab8ccfed693a48dce83cb78dc369be5c4 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 31 May 2021 17:59:01 +0000 Subject: [PATCH] python3Packages.hg-evolve: add a basic smoke test --- .../python-modules/hg-evolve/default.nix | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hg-evolve/default.nix b/pkgs/development/python-modules/hg-evolve/default.nix index e74b61ee9968..a0229d1e5012 100644 --- a/pkgs/development/python-modules/hg-evolve/default.nix +++ b/pkgs/development/python-modules/hg-evolve/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , fetchPypi -, isPy3k +, mercurial }: buildPythonPackage rec { @@ -13,7 +13,42 @@ buildPythonPackage rec { sha256 = "ba819732409d39ddd4ff2fc507dc921408bf30535d2d78313637b29eeac98860"; }; - doCheck = false; + checkInputs = [ + mercurial + ]; + + checkPhase = '' + runHook preCheck + + export TESTTMP=$(mktemp -d) + export HOME=$TESTTMP + cat <$HOME/.hgrc + [extensions] + evolve = + topic = + EOF + + # Shipped tests use the mercurial testing framework, and produce inconsistent results. + # Do a quick smoke-test to see if things do what we expect. + hg init $TESTTMP/repo + pushd $TESTTMP/repo + touch a + hg add a + hg commit -m "init a" + hg topic something + + touch b + hg add b + hg commit -m "init b" + + echo hi > b + hg amend + + hg obslog + popd + + runHook postCheck + ''; meta = with lib; { description = "Enables the “changeset evolution” feature of Mercurial core";