You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@yetus.apache.org by "Kengo Seki (JIRA)" <ji...@apache.org> on 2015/12/04 20:05:11 UTC
[jira] [Updated] (YETUS-22) test-patch should check for API
breakage without version # change
[ https://issues.apache.org/jira/browse/YETUS-22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kengo Seki updated YETUS-22:
----------------------------
Attachment: YETUS-22.00.patch
-00: early prototype. It just runs jacc with no context.
It requires jacc 1.4.3+ on OS X because of [this issue|https://github.com/lvc/japi-compliance-checker/issues/21].
example:
{code}
[sekikn@localhost yetus]$ cat /tmp/p
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
index 8355d96..eb24f0f 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
@@ -3024,18 +3024,4 @@ public static void dumpDeprecatedKeys() {
System.out.println(entry.getKey() + "\t" + newKeys.toString());
}
}
-
- /**
- * Returns whether or not a deprecated name has been warned. If the name is not
- * deprecated then always return false
- */
- public static boolean hasWarnedDeprecation(String name) {
- DeprecationContext deprecations = deprecationContext.get();
- if(deprecations.getDeprecatedKeyMap().containsKey(name)) {
- if(deprecations.getDeprecatedKeyMap().get(name).accessed.get()) {
- return true;
- }
- }
- return false;
- }
}
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationDeprecation.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationDeprecation.java
index 93a235a..6c9a814 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationDeprecation.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationDeprecation.java
@@ -400,18 +400,6 @@ public Void call() throws Exception {
Uninterruptibles.getUninterruptibly(future);
}
}
-
- @Test
- public void testNoFalseDeprecationWarning() throws IOException {
- Configuration conf = new Configuration();
- Configuration.addDeprecation("AA", "BB");
- conf.set("BB", "bb");
- conf.get("BB");
- conf.writeXml(new ByteArrayOutputStream());
- assertEquals(false, Configuration.hasWarnedDeprecation("AA"));
- conf.set("AA", "aa");
- assertEquals(true, Configuration.hasWarnedDeprecation("AA"));
- }
@Test
public void testDeprecationSetUnset() throws IOException {
[sekikn@localhost yetus]$ precommit/test-patch.sh --basedir=../hadoop --project=hadoop --resetrepo /tmp/p
(snip)
| Vote | Subsystem | Runtime | Comment
============================================================================
| +1 | @author | 0m 0s | The patch does not contain any @author
| | | | tags.
| +1 | test4tests | 0m 0s | The patch appears to include 1 new or
| | | | modified test files.
| +1 | mvninstall | 6m 2s | trunk passed
| +1 | checkstyle | 0m 14s | trunk passed
| +1 | mvnsite | 0m 55s | trunk passed
| +1 | mvneclipse | 0m 13s | trunk passed
| +1 | findbugs | 1m 51s | trunk passed
| +1 | mvninstall | 0m 41s | the patch passed
| -1 | jacc | 9m 27s | API incompatibilities found on
| | | | hadoop-tools-dist, hadoop-common,
| | | | hadoop-mapreduce-examples,
| | | | hadoop-build-tools, hadoop-project-dist,
| | | | hadoop-dist, hadoop-hdfs-native-client,
| | | | hadoop-client, hadoop-minicluster,
| | | | hadoop-assemblies
| -1 | checkstyle | 0m 14s | Patch generated 1 new checkstyle issues
| | | | in hadoop-common-project/hadoop-common
| | | | (total was 176, now 175).
| +1 | mvnsite | 0m 55s | the patch passed
| +1 | mvneclipse | 0m 13s | the patch passed
| -1 | whitespace | 0m 0s | The patch has 83 line(s) that end in
| | | | whitespace. Use git apply
| | | | --whitespace=fix.
| +1 | findbugs | 1m 48s | the patch passed
| +1 | asflicense | 0m 19s | Patch does not generate ASF License
| | | | warnings.
| | | 26m 19s |
|| Subsystem || Report/Notes ||
============================================================================
| Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle jacc |
| uname | Linux localhost.localdomain 2.6.32-573.8.1.el6.x86_64 #1 SMP Tue Nov 10 18:01:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | /home/sekikn/yetus/precommit/personality/hadoop.sh |
| git revision | trunk / 0ac8fb4 |
| findbugs | v3.0.0 |
| jacc | /tmp/yetus-7293.1729/compat_reports |
| checkstyle | /tmp/yetus-7293.1729/diff-checkstyle-hadoop-common-project_hadoop-common.txt |
| whitespace | /tmp/yetus-7293.1729/whitespace-eol.txt |
| modules | C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common |
| Max memory used | 100MB |
| Powered by | Apache Yetus http://yetus.apache.org |
{code}
many TODOs:
* fix false-alarms. In the above example, all errors other than hadoop-common are them. :(
* add options and usage
* check whether jacc is installed
* improve links in the footer table
* support Hadoop audience annotations
* For now, this plugin only supports maven and runs jacc on _precompile phase, because we can expect that "mvn install" has already run at that point and avoid running "mvn install" multiple times. But it probably should run proper build command corresponding to the build tool on _rebuild phase.
> test-patch should check for API breakage without version # change
> -----------------------------------------------------------------
>
> Key: YETUS-22
> URL: https://issues.apache.org/jira/browse/YETUS-22
> Project: Yetus
> Issue Type: New Feature
> Components: Test Patch
> Reporter: Sean Busbey
> Attachments: YETUS-22.00.patch
>
>
> HBase has some automated tooling for checking for API breakage with the Java API Compliance Checker tool. It'd be nice ot have it as a pre-commit plugin.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)