Closed niloc132 closed 6 years ago
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.
Remaining tests are fixed in the same way in github.com/vertispan/jsinterop-generator/commit/08648b7b031efad300f33430bde90f62194eb87c
CLAs look good, thanks!
The generator emits all imports but we use the google java format tool in order to format both generated files and golden files before to compare them. The formatter should remove the unnecessary imports (at least the internal version does). I'll investigate.
Hmm - comment typos probably aren't covered by that though, how are those tests passing internally? Or is the diff presented when the test fails just a hint at the problem, but comments don't actually get used in comparing?
Should be fixed with : 899c11d09e7fe731a453ea0bef2ba3a8f5312e83
Could you retest?
Hmm - comment typos probably aren't covered by that though, how are those tests passing internally?
Comments are stripped before comparing file contents.
Will retest today, thanks. Would be nice to apply the same comment-stripper before seeing output, and maybe don't even put the comments in the "expected" source if they aren't actually expected to be there?
Or, since they are actually useful (before super() calls), perhaps don't strip them?
Thanks again.
Looking better for sure - 2 failed, both comment related. Here's the generated diffs.
//javatests/jsinterop/generator/externs/dependency:dependency FAILED in 8.6s
--- /var/folders/hd/d1bzsn8x6s385s5nkc1m29zr0000gn/T/tmp.i2Tjvcz1/jsinterop/generator/externs/dependency/MyLibThirdPartyClass.java 2018-05-30 20:17:48.000000000 +0000
+++ /var/folders/hd/d1bzsn8x6s385s5nkc1m29zr0000gn/T/tmp.KaBTtyky/MyLibThirdPartyClass.java 2018-05-31 01:17:49.000000000 +0000
@@ -51,17 +51,14 @@
public ThirdParty2Class extraField;
public MyLibThirdPartyClass(ThirdPartyClass.ConstructorFooUnionType foo) {
- // This call is only here for java compilation purpose.
super((ThirdPartyClass.ConstructorFooUnionType) null);
}
public MyLibThirdPartyClass(String foo) {
- // This call is only here for java compilation purpose.
super((ThirdPartyClass.ConstructorFooUnionType) null);
}
public MyLibThirdPartyClass(double foo) {
- // This call is only here for java compilation purpose.
super((ThirdPartyClass.ConstructorFooUnionType) null);
}
//javatests/jsinterop/generator/externs/inheritance:Inheritance FAILED in 21.8s
--- /var/folders/hd/d1bzsn8x6s385s5nkc1m29zr0000gn/T/tmp.665RbXj7/jsinterop/generator/externs/inheritance/GreatParentClass.java 2018-05-30 20:17:24.000000000 +0000
+++ /var/folders/hd/d1bzsn8x6s385s5nkc1m29zr0000gn/T/tmp.2jS0YUtu/GreatParentClass.java 2018-05-31 01:17:26.000000000 +0000
@@ -8,7 +8,7 @@
public double greatParentClassProperty;
public GreatParentClass(String s, boolean b, double n) {
- // This call is only here for java compilation purpose.
+ // This call is only there for java compilation purpose.
super((Object) null);
}
From this it appears that the import issue is resolved, but that comments are not stripped, changes are detected.
I can update this PR to reflect this? Or do you want to change how the test works instead?
out of curiosity: Are you on mac os? Tests works fine on my linux machine but fails on my Mac.
Seems the sed command I use in javatests/jsinterop/generator/jsinterop_generator_test.sh for stripping comments doesn't work on mac os :
# allows us to comment some part of java code when a feature is not implemented.
strip_java_comments() {
find "$1" -type f -name '*.java' -print -exec sed -i '/\/\/.*$/d' '{}' \;
}
I'll investigate that tomorrow
Yes, I am running on a mac.
With the BSD build of sed (one installed by default on Mac OS X), backup extension is mandatory when you specify -i
option.
I've a patch internally to fix that. It should be pushed today
Should be fixed with bbbd78c could you sync and rerun the tests?
All passing locally now, thanks!
These imports probably shouldnt be necessary, but seems to reflect the current state of what the generator emits, and allowing the test to otherwise pass means that we can still use the test to know that other aspects of the project are working.
Error before this change:
Contents of that file: