Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the library versions used of dependencies used by the build #1291

Merged
merged 1 commit into from
May 26, 2023

Conversation

merks
Copy link
Contributor

@merks merks commented May 24, 2023

Update the setup to provide a functional targlet task that generates the org.eclipse.birt.target.target to match.

Do not use any repository reference for the build but rather use purely the *.target.

Use plugin-source's feature-source for feature source generation and ensure now warnings about plugins/features without sources.

Reduce noise from Javadoc generation.

#1286

@merks
Copy link
Contributor Author

merks commented May 24, 2023

@wimjongman

The build works for me locally, but I run it with a Java 17 JVM. So I think that's why the Javadoc generation fails:

 Warning:    [javadoc] /home/runner/work/birt/birt/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/plugin/ChartEnginePlugin.java:18: error: cannot access Plugin
Warning:    [javadoc] import org.eclipse.core.runtime.Plugin;
Warning:    [javadoc]                                ^
Warning:    [javadoc]   bad class file: /home/runner/.m2/repository/p2/osgi/bundle/org.eclipse.core.runtime/3.27.0.v20230515-1719/org.eclipse.core.runtime-3.27.0.v20230515-1719.jar(/org/eclipse/core/runtime/Plugin.class)
Warning:    [javadoc]     class file has wrong version 61.0, should be 55.0
Warning:    [javadoc]     Please remove or make sure it appears in the correct subdirectory of the classpath.
Warning:    [javadoc] /home/runner/work/birt/birt/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/plugin/ChartEnginePlugin.java:25: error: cannot find symbol
Warning:    [javadoc] public class ChartEnginePlugin extends Plugin {
Warning:    [javadoc]                                        ^
Warning:    [javadoc]   symbol: class Plugin

So I think this needs to use Java 17:

image

@merks
Copy link
Contributor Author

merks commented May 24, 2023

I guess it's this that needs to change:

image

But I think that even when I change this, for security reasons, the action won't use my version. I can try but I doubt that will work...

@merks
Copy link
Contributor Author

merks commented May 24, 2023

Actually maybe that security measure is not in place because it does seem to have worked:

image

@merks
Copy link
Contributor Author

merks commented May 24, 2023

@wimjongman

The build part worked. Locally I let the build run the tests and just use "clean verify", but in this thing uses mvn clean install --no-transfer-progress -U -DskipTests and then the tests run separately based on what's installed I guess but I'm not sure why not just let the tests run and use -fail-at-end to ensure all the tests run...

This looks like the fatal part of the failure to launch the test:

Warning: eclipse-plugin:org.eclipse.help.base:4.4.0.v20230524-0600: null can not be represented in Maven model and will not be visible to non-OSGi aware Maven plugins.

The test itself is successful in the workspace:

image

I'm not sure what to make of this.

I've tried to run all the tests locally in the Tycho build, but my IDE keeps getting dead locked when I do that...

@merks
Copy link
Contributor Author

merks commented May 24, 2023

My local build for that test is like this:

[INFO] ------------< org.eclipse.birt:org.eclipse.birt.tests.data >------------
[INFO] Building org.eclipse.birt.tests.data 4.13.0-SNAPSHOT [163/288]
[INFO] ------------------------[ eclipse-test-plugin ]-------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.eclipse.birt.tests.data ---
[INFO] Deleting D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target
[INFO]
[INFO] --- tycho-packaging-plugin:2.7.5:build-qualifier (default-build-qualifier) @ org.eclipse.birt.tests.data ---
[INFO] The project's OSGi version is 4.13.0.v202305241236
[INFO]
[INFO] --- tycho-packaging-plugin:2.7.5:validate-id (default-validate-id) @ org.eclipse.birt.tests.data ---
[INFO]
[INFO] --- tycho-packaging-plugin:2.7.5:validate-version (default-validate-version) @ org.eclipse.birt.tests.data ---
[INFO]
[INFO] --- target-platform-configuration:2.7.5:target-platform (default-target-platform) @ org.eclipse.birt.tests.data ---
[INFO] Maven Artifact org.codehaus.mojo:animal-sniffer-annotations:1.9 is not a bundle and will be ignored, automatic wrapping of such artifacts can be enabled with wrapAsBundle in target platform configuration.
[INFO] Maven Artifact org.milyn:flute:1.3 is not a bundle and will be ignored, automatic wrapping of such artifacts can be enabled with wrapAsBundle in target platform configuration.
[INFO]
[INFO] --- tycho-compiler-plugin:2.7.5:validate-classpath (default-validate-classpath) @ org.eclipse.birt.tests.data ---
[INFO] Resolving class path of org.eclipse.birt.tests.data...
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.9:prepare-agent (jacoco-prepare-agent) @ org.eclipse.birt.tests.data ---
[INFO] tycho.testArgLine set to -javaagent:D:\Users\merks\.m2\repository\org\jacoco\org.jacoco.agent\0.8.9\org.jacoco.agent-0.8.9-runtime.jar=destfile=D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ org.eclipse.birt.tests.data ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\src\main\resources
[INFO]
[INFO] --- tycho-compiler-plugin:2.7.5:compile (default-compile) @ org.eclipse.birt.tests.data ---
[INFO] Compiling 15 source files to D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ org.eclipse.birt.tests.data ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\src\test\resources
[INFO]
[INFO] --- tycho-packaging-plugin:2.7.5:update-consumer-pom (default-update-consumer-pom) @ org.eclipse.birt.tests.data ---
[INFO]
[INFO] --- tycho-source-plugin:2.7.5:plugin-source (plugin-source) @ org.eclipse.birt.tests.data ---
[INFO] Building jar: D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\org.eclipse.birt.tests.data-4.13.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (process-about.mappings) @ org.eclipse.birt.tests.data ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 0 resource
[INFO]
[INFO] --- tycho-packaging-plugin:2.7.5:package-plugin (default-package-plugin) @ org.eclipse.birt.tests.data ---
[INFO] Building jar: D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\DtEtests.jar
[INFO] Building jar: D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\org.eclipse.birt.tests.data-4.13.0-SNAPSHOT.jar
[INFO]
[INFO] --- tycho-p2-plugin:2.7.5:p2-metadata-default (default-p2-metadata-default) @ org.eclipse.birt.tests.data ---
[INFO]
[INFO] --- tycho-source-plugin:2.7.5:feature-source (feature-source) @ org.eclipse.birt.tests.data ---
[INFO]
[INFO] --- tycho-p2-plugin:2.7.5:p2-metadata (attached-p2-metadata) @ org.eclipse.birt.tests.data ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.9:prepare-agent-integration (jacoco-prepare-agent-integration) @ org.eclipse.birt.tests.data ---
[INFO] tycho.testArgLine set to -javaagent:D:\Users\merks\.m2\repository\org\jacoco\org.jacoco.agent\0.8.9\org.jacoco.agent-0.8.9-runtime.jar=destfile=D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\jacoco-it.exec
[INFO]
[INFO] --- tycho-surefire-plugin:2.7.5:test (default-test) @ org.eclipse.birt.tests.data ---
[INFO] Could not find a java toolchain of type jdk, using java from JAVA_HOME instead (C:\Program Files\Java\jdk-17.0.5+8\bin\java.exe)
[INFO] Executing Test Runtime with timeout 0, logs (if any) will be placed at: D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\work\data.metadata.log
[INFO] Command line:
[C:\Program Files\Java\jdk-17.0.5+8\bin\java.exe, -Dosgi.noShutdown=false, -Dosgi.os=win32, -Dosgi.ws=win32, -Dosgi.arch=x86_64, -Dosgi.java.profile=file:/D:/Users/merks/birt-master/git/birt/testsuites/org.eclipse.birt.tests.data/target/custom.profile, -javaagent:D:\Users\merks\.m2\repository\org\jacoco\org.jacoco.agent\0.8.9\org.jacoco.agent-0.8.9-runtime.jar=destfile=D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\jacoco-it.exec, -Dosgi.clean=true, -jar, D:\Users\merks.m2\repository\p2\osgi\bundle\org.eclipse.equinox.launcher\1.6.400.v20210924-0641\org.eclipse.equinox.launcher-1.6.400.v20210924-0641.jar, -data, D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\work\data, -install, D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\work, -configuration, D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\work\configuration, -application, org.eclipse.tycho.surefire.osgibooter.headlesstest, -testproperties, D:\Users\merks\birt-master\git\birt\testsuites\org.eclipse.birt.tests.data\target\surefire.properties]
Running org.eclipse.birt.tests.data.engine.AllTests
Tests run: 10, Failures: 0, Errors: 10, Skipped: 0, Time elapsed: 0.298 s <<< FAILURE! - in org.eclipse.birt.tests.data.engine.AllTests
test_InvalidValueFilterGroup(org.eclipse.birt.tests.data.engine.api.MultiPass_FilterTest) Time elapsed: 0.218 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_FilteWithTopN(org.eclipse.birt.tests.data.engine.api.MultiPass_FilterTest) Time elapsed: 0.009 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_FilterWithBottomN(org.eclipse.birt.tests.data.engine.api.MultiPass_FilterTest) Time elapsed: 0.004 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_FilterGroup(org.eclipse.birt.tests.data.engine.api.MultiPass_FilterTest) Time elapsed: 0.005 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_MultiPassFilterGroup(org.eclipse.birt.tests.data.engine.api.MultiPass_FilterTest) Time elapsed: 0.003 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_NegativeValueFilterGroup(org.eclipse.birt.tests.data.engine.api.MultiPass_FilterTest) Time elapsed: 0.003 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_sortOnGroupKey(org.eclipse.birt.tests.data.engine.api.MultiPass_SortTest) Time elapsed: 0.003 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_sortGroup(org.eclipse.birt.tests.data.engine.api.MultiPass_SortTest) Time elapsed: 0.003 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_SortOnAggregationExpression(org.eclipse.birt.tests.data.engine.api.MultiPass_SortTest) Time elapsed: 0.004 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

test_RunningAggregationExpression(org.eclipse.birt.tests.data.engine.api.MultiPassTest) Time elapsed: 0.003 s <<< ERROR!
org.eclipse.birt.core.exception.CoreException: No such script extension : javascript.

Results:

Errors:
MultiPassTest>APITestCase.setUp:81 � Core No such script extension : javascrip...
MultiPass_FilterTest>APITestCase.setUp:81 � Core No such script extension : ja...
MultiPass_FilterTest>APITestCase.setUp:81 � Core No such script extension : ja...
MultiPass_FilterTest>APITestCase.setUp:81 � Core No such script extension : ja...
MultiPass_FilterTest>APITestCase.setUp:81 � Core No such script extension : ja...
MultiPass_FilterTest>APITestCase.setUp:81 � Core No such script extension : ja...
MultiPass_FilterTest>APITestCase.setUp:81 � Core No such script extension : ja...
MultiPass_SortTest>APITestCase.setUp:81 � Core No such script extension : java...
MultiPass_SortTest>APITestCase.setUp:81 � Core No such script extension : java...
MultiPass_SortTest>APITestCase.setUp:81 � Core No such script extension : java...
Tests run: 10, Failures: 0, Errors: 10, Skipped: 0

@merks
Copy link
Contributor Author

merks commented May 24, 2023

Before I thrash too much more on this, I'll wait for some comments. Perhaps you've seen issues like this before...

@wimjongman
Copy link
Contributor

Ed, reviving the tests was quite an effort, so we stopped running all tests and added each fixed suite one by one in the way you see us do now. We are executing all tests we have fixed, but I don't know if these are all the available tests.

@merks
Copy link
Contributor Author

merks commented May 25, 2023

@wimjongman

There are many more tests than just the ones being run. My latest PR disables all tests by default skipTests=true and enables only those tests that were currently running, plus I enabled org.eclipse.birt.core.tests after fixing a few failures. For me locally, all the tests that were previously running do now also run and pass locally as part of a single mvn invocation. Let's keep our fingers crossed that this works exactly the same on the builder server.

@merks
Copy link
Contributor Author

merks commented May 25, 2023

@wimjongman

It looks like I did it correctly. All the tests that previous ran still run and pass. But I don't know if you publish some details about the tests results. You have to look in the log to see that they did actually run and pass.

Hopefully we can move forward from this without a need to rebase!

@speckyspooky
Copy link
Contributor

@merks I read your mail with the comment of:

// diagonal & antidiagonal special function
addCellDiagonalSpecial();

and the usage of openRootTag().

Please be aeware that is not wrong by default. Because the function add a special HTML-JavaScript for the header.
This is important for the Cell-diagonal and background image handling.

So the call was figured out on my research. If you can see in the source before the openRootTag() is called twice and this is part of the original implementation (before my cell diagonal change was done).

So if you change it then you it would be good if the functionality of the added script is given already.

@merks
Copy link
Contributor Author

merks commented May 26, 2023

With the local changes (not yet in this PR) this is the actual result from the emitter for the test case:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
			<script type="text/javascript">
			 //<![CDATA[
			   function combineBgImageAndDiagonal(id, diagUri) {
			     var nTd = document.getElementById(id);
			     if (nTd) {
			       var nStyle = getComputedStyle(nTd);
			       if (nStyle && nStyle.backgroundImage) {
			         var bgStyle = '';
			         bgStyle += 'background-image:' + diagUri + ', ' + nStyle.backgroundImage + ';'	;
			         bgStyle += 'background-size:100% 100%, ' + nStyle.backgroundSize + ';'			;
			         bgStyle += 'background-repeat:no-repeat, ' + nStyle.backgroundRepeat + ';'		;
			         bgStyle += 'background-position: center, ' + nStyle.backgroundPosition + ';'	;
			         bgStyle += 'background-position-x:' + nStyle.backgroundPositionY + ';'			;
			         bgStyle += 'background-position-y:' + nStyle.backgroundPositionX + ';'			;
			         bgStyle += 'background-attachment:' + nStyle.backgroundAttachment + ';'			;
			         bgStyle += 'overflow:hidden;';
			         nTd.setAttribute('style' , bgStyle);
			       }
			     }
			   }
			 //]]>
			</script>
			<script type="text/javascript">
			 //<![CDATA[
			   function redirect(target, url){
			       if (target =='_blank'){
			           open(url);
			       }
			       else if (target == '_top'){
			           window.top.location.href=url;
			       }
			       else if (target == '_parent'){
			           location.href=url;
			       }
			       else if (target == '_self'){
			           location.href =url;
			       }
			       else{
			           open(url);
			       }
			      }
			 //]]>
			</script>
		</head>
		<body style=" margin:0px;">
			<table cellpadding="0" style="empty-cells: show; border-collapse:collapse;width:100%;">
				<tr>
					<td valign="top"></td>
				</tr>
			</table>
		</body>
	</html>

The indentation of is off because at some point not that long ago the logic to close the meta tag was made conditional. I added the CDATA stuff like the other methods used. Does that look correct?

Update the setup to provide a functional targlet task that generates the
org.eclipse.birt.target.target to match.

Do not use any repository reference for the build but rather use purely
the *.target.

Use plugin-source's feature-source for feature source generation and
ensure now warnings about plugins/features without sources.

Reduce noise from Javadoc generation.

Ensure that skipTests is the default and enable those tests that
are currently running in the builds and also enable many of the other
tests that were not currently running and fix tests failing with the
latest libraries and versions.

eclipse-birt#1286
@merks
Copy link
Contributor Author

merks commented May 26, 2023

The build runs these 17 tests now:

image

@wimjongman
Copy link
Contributor

Cheers, Ed! That is awesome.

@merks
Copy link
Contributor Author

merks commented May 26, 2023

It's ready to commit as far as I'm concern. Does anything speak against that?

@wimjongman wimjongman self-requested a review May 26, 2023 13:57
@wimjongman wimjongman merged commit 3a05180 into eclipse-birt:master May 26, 2023
@wimjongman wimjongman added this to the 4.14 milestone May 26, 2023
@wimjongman wimjongman mentioned this pull request May 26, 2023
@merks
Copy link
Contributor Author

merks commented May 26, 2023

Thanks! I will now focus on what needs to be promoted and how best to manage that...

@merks merks deleted the issue-1286 branch May 26, 2023 14:50
@speckyspooky
Copy link
Contributor

Your example looks good. The meta tag is open tag given through the standard but based on history it was necessary to close them. I think also the CDATA-fragments are old code because the part are commented out.

@merks
Copy link
Contributor Author

merks commented May 26, 2023

It's very weird not to close it, but there was a comment about a bugzilla relative to that code being conditional. But it looks ugly and seems wrong to me...

I'm not sure what you mean by "parts are commented out." It's a "standard pattern" to use such "brackets" around Javascript content:

https://stackoverflow.com/questions/66837/when-is-a-cdata-section-necessary-within-a-script-tag

@speckyspooky
Copy link
Contributor

Yes, the meta-tag looks wrong but it is right. The current standard of HTML allow that. If there would be the xhtml stanard would be used then it would be an empty tag with "/" like "<meta ... />" but HTML5 doesn't like in every case the xhtml syntax.

And I mean the CDATA is commented: if you execute your example on a browser the CDATA will be ignored because it is commented with "//" but if you use it in an xml-parse process it is necessary that the content of CDATA will not be parsed.

Therefore you will not the such script-start-sequence by default on the HTML-pages (but necessary for the xml-parsing process).

@merks
Copy link
Contributor Author

merks commented May 26, 2023

I can't parse "you will not the such script-start-sequence" so I'm not sure what you are trying to say. There isn't a problem is there?

@speckyspooky
Copy link
Contributor

You can go ahead with your changes, all is fine.

I tried to say

  • with point of HTML / browser: "...//<![CDATA[..." is a comment
  • with point of XML-parser: "...//<![CDATA[..." is a valid construct to unparse the content of it

If you take a look into browser-dev-tools you won't be see "...//<![CDATA[..."

@merks
Copy link
Contributor Author

merks commented May 27, 2023

Yes, I see the point. In normal HTML there is no support for <![CDATA[ so it's just noise. Only XHTML has such support. I just changed things to be consistent with the rest of the code. Also to avoid using "\n" in the literals since in Windows is "\r\n", but those are just minor details. Thanks for the feedback and review!!

@speckyspooky
Copy link
Contributor

@merks & @wimjongman

It seems to me that we have an impact with this PR.
@merks: You have changed the HTML-emitter due to some "wrong method orders" and you changed it.
But currently the HTML in the viewer is wrong. With my original version of the cell-diagonal all was fine.

You can see it also on your screen of yesterday. Att the top of the preview you will see a part of a "class"-attribute.
So I think the change crash the new feature an the problem is that the effect of the displayed attribute-value is on "all" reports.

I invested lot of time to handle the HTML-emitter correctly and know we have issues again
and this time it will be harder.

Please remove your changes of the HTMLReportEmitter and restore my version before.

Examples of corrupted HTML-preview:

2023-06-04 17_31_23-BIRT Report Viewer – Mozilla Firefox

2023-06-04 17_31_38-image-SMP-URL – Mozilla Firefox

@speckyspooky
Copy link
Contributor

I have done the fix under #1305 - HTMLReportEmitter.

I have corrected the method call sequence which is now correct like before.
Your changes of the string-concatination are unchanged.

@merks
Copy link
Contributor Author

merks commented Jun 4, 2023

I can help with the failing test tomorrow.

@speckyspooky
Copy link
Contributor

I improved the emitter and the test case was running sucessfully for the new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants