[PATCH V2] tests: avoid obsolete marker warnings on the hg code repo without evolve
timeless
timeless at gmail.com
Sat May 7 21:58:43 EDT 2016
Let's have a helper script which does this and just . include it from all
the scripts that use it.
On May 6, 2016 10:28 PM, "Matt Harbison" <mharbison72 at gmail.com> wrote:
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1462585858 14400
# Fri May 06 21:50:58 2016 -0400
# Node ID f3156cc10f6d6df6463f534279a3bd73a85fc06b
# Parent af6d4a49e3615ac6cfa63b9c10811c28520434ea
tests: avoid obsolete marker warnings on the hg code repo without evolve
These tests run on the local Mercurial repository. If evolve is enabled in
a
config file other than the local file, it isn't loaded for the test,
causing the
warning to be emitted if obsolete markers are found. (Having said that, I
see
that the Linux install I have enables evolve only from the user config, so
maybe
this is somehow Windows specific?)
The problem tests observed between timeless and I were limited to
*-shbang.t and
*-execute.t. But since check-commit.t also had this from the beginning, I
added
this to all of the other check-* tests with #require test-repo for
consistency.
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -1,5 +1,11 @@
#require test-repo
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ check_code="$TESTDIR"/../contrib/check-code.py
$ cd "$TESTDIR"/..
diff --git a/tests/test-check-config.t b/tests/test-check-config.t
--- a/tests/test-check-config.t
+++ b/tests/test-check-config.t
@@ -1,5 +1,11 @@
#require test-repo
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ cd "$TESTDIR"/..
New errors are not allowed. Warnings are strongly discouraged.
diff --git a/tests/test-check-execute.t b/tests/test-check-execute.t
--- a/tests/test-check-execute.t
+++ b/tests/test-check-execute.t
@@ -1,5 +1,11 @@
#require test-repo execbit
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ cd "`dirname "$TESTDIR"`"
look for python scripts without the execute bit
diff --git a/tests/test-check-module-imports.t
b/tests/test-check-module-imports.t
--- a/tests/test-check-module-imports.t
+++ b/tests/test-check-module-imports.t
@@ -1,5 +1,11 @@
#require test-repo
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ import_checker="$TESTDIR"/../contrib/import-checker.py
Run the doctests from the import checker, and make sure
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -1,5 +1,11 @@
#require test-repo
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ cd "$TESTDIR"/..
$ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python
contrib/check-py3-compat.py
diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -1,5 +1,11 @@
#require test-repo pyflakes
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ cd "`dirname "$TESTDIR"`"
run pyflakes on all tracked files ending in .py or without a file ending
diff --git a/tests/test-check-shbang.t b/tests/test-check-shbang.t
--- a/tests/test-check-shbang.t
+++ b/tests/test-check-shbang.t
@@ -1,5 +1,11 @@
#require test-repo
+ $ cat >> $HGRCPATH <<EOF
+ > # Silence "obsolete feature not enabled, but markers found" warnings
+ > [experimental]
+ > evolution=createmarkers
+ > EOF
+
$ cd "`dirname "$TESTDIR"`"
look for python scripts that do not use /usr/bin/env
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel at mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160507/43d64dea/attachment.html>
More information about the Mercurial-devel
mailing list