eclipse / Xpect

This repository has been rewritten to move to the Eclipse Foundation. Find the old history here: https://github.com/TypeFox/Xpect
http://www.xpect-tests.org/
Eclipse Public License 2.0
32 stars 28 forks source link

adjust Jenkinsfile for eclipse infra #227

Closed yoosiba closed 6 years ago

yoosiba commented 6 years ago

resolves #225

This PR contains small modifications to the Jenkinsfile to allow building on https://ci.eclipse.org/xpect/ Changes are rather minimal, just enough to address main points of #225

issue with failing builds is resolved

Failing build

note that there is failing build for this branch: https://ci.eclipse.org/xpect/job/Xpect/job/jenkinsfile-eclipse/9/

~~It seems some issue is in tests with Eclipse Luna and Xtext 2.9.2 IMHO tests should be fixed in a separate task, i.e. should not block this PR build log excerpt~~

yoosiba commented 6 years ago

@meysholdt Could you take a look? In case you approve it I would like to squash-merge this.

yoosiba commented 6 years ago

Checked failing tests in Eclipse, they pass as JUnit tests, but fail with the same exception when executed as JUnitPlugin tests.

yoosiba commented 6 years ago

Actually when we launch XjmContributionsTest as Plugin Tests from eclipse it fails, but when we launch whole project as Plugin Tests then all tests in this specific class pass.

yoosiba commented 6 years ago

It seems that failing build on Jenkins is somehow related to the setup. Locally cannot reproduce the failing build.

Used following script to mimic Jenkinsfile build on the command line:

echo "\x0c"
#clear
echo "compile with Eclipse Luna and Xtext 2.9.2"

mvnParams="--batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false"
mvn -P!tests -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 $mvnParams clean install

echo -en "test with Eclipse Luna and Xtext 2.9.2"
mvn -P!plugins -P!xtext-examples -Dtarget-platform=eclipse_4_4_2-xtext_2_9_2 $mvnParams clean integration-test

echo -en "test with Eclipse Mars and Xtext nighly"
mvn -P!plugins -P!xtext-examples -Dtarget-platform=eclipse_4_5_0-xtext_nightly $mvnParams clean integration-test

this yields positive results:

compile with Eclipse Luna and Xtext 2.9.2
(...)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] org.eclipse.xpect.target.eclipse_4_4_2-xtext_2_9_2 . SUCCESS [02:19 min]
[INFO] org.eclipse.xpect .................................. SUCCESS [01:13 min]
[INFO] org.eclipse.xpect.ui ............................... SUCCESS [  1.796 s]
[INFO] org.eclipse.xpect.ui.junit ......................... SUCCESS [  0.900 s]
[INFO] org.eclipse.xpect.xtext.lib ........................ SUCCESS [  1.069 s]
[INFO] org.eclipse.xpect.xtext.xbase.lib .................. SUCCESS [  0.578 s]
[INFO] org.eclipse.xpect.xtext.lib.feature ................ SUCCESS [  0.135 s]
[INFO] org.eclipse.xpect.xtext.xbase.lib.feature .......... SUCCESS [  0.107 s]
[INFO] org.eclipse.xpect.sdk .............................. SUCCESS [  0.106 s]
[INFO] org.eclipse.xpect.repository ....................... SUCCESS [  5.333 s]
[INFO] org.eclipse.xtext.example.maven_parents.grammar_plugin SUCCESS [  3.547 s]
[INFO] org.eclipse.xtext.example.arithmetics .............. SUCCESS [ 14.458 s]
[INFO] org.eclipse.xtext.example.arithmetics.ide .......... SUCCESS [  0.559 s]
[INFO] org.eclipse.xtext.example.arithmetics.ui ........... SUCCESS [  5.209 s]
[INFO] org.eclipse.xtext.example.domainmodel .............. SUCCESS [ 27.537 s]
[INFO] org.eclipse.xtext.example.domainmodel.ui ........... SUCCESS [  1.915 s]
[INFO] org.eclipse.xpect.root ............................. SUCCESS [  0.081 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:21 min
[INFO] Finished at: 2017-11-14T16:13:00+01:00
[INFO] Final Memory: 142M/1213M
[INFO] ------------------------------------------------------------------------
(...)
-en test with Eclipse Luna and Xtext 2.9.2
(...)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] org.eclipse.xpect.target.eclipse_4_4_2-xtext_2_9_2 . SUCCESS [ 12.404 s]
[INFO] org.eclipse.xtext.example.arithmetics.tests ........ SUCCESS [ 21.950 s]
[INFO] org.eclipse.xtext.example.domainmodel.tests ........ SUCCESS [  3.767 s]
[INFO] org.eclipse.xpect.tests ............................ SUCCESS [ 16.302 s]
[INFO] org.eclipse.xpect.xtext.lib.tests .................. SUCCESS [ 16.923 s]
[INFO] org.eclipse.xtext.example.arithmetics.xpect.tests .. SUCCESS [ 17.084 s]
[INFO] org.eclipse.xtext.example.domainmodel.xpect.tests .. SUCCESS [ 40.350 s]
[INFO] org.eclipse.xpect.root ............................. SUCCESS [  0.018 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33:05 min
[INFO] Finished at: 2017-11-14T16:46:08+01:00
[INFO] Final Memory: 138M/1564M
[INFO] ------------------------------------------------------------------------
(...)
-en test with Eclipse Mars and Xtext nighly
(...)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] org.eclipse.xpect.target.eclipse_4_5_0-xtext_nightly SUCCESS [ 13.124 s]
[INFO] org.eclipse.xtext.example.arithmetics.tests ........ SUCCESS [  5.521 s]
[INFO] org.eclipse.xtext.example.domainmodel.tests ........ SUCCESS [  3.850 s]
[INFO] org.eclipse.xpect.tests ............................ SUCCESS [ 14.796 s]
[INFO] org.eclipse.xpect.xtext.lib.tests .................. SUCCESS [ 16.371 s]
[INFO] org.eclipse.xtext.example.arithmetics.xpect.tests .. SUCCESS [  8.102 s]
[INFO] org.eclipse.xtext.example.domainmodel.xpect.tests .. SUCCESS [ 36.379 s]
[INFO] org.eclipse.xpect.root ............................. SUCCESS [  0.016 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:38 min
[INFO] Finished at: 2017-11-14T16:50:49+01:00
[INFO] Final Memory: 136M/1186M
[INFO] ------------------------------------------------------------------------
meysholdt commented 6 years ago

Thank you for looking into this... It's interesting that Jenkins does not show the result of the failed tests. That would help to understand why they fail on Jenkins but not locally.

maybe

sh "${mvnHome}/bin/mvn -P!plugins -P!xtext-examples....
junit '**/TEST-*.xml'

needs to be converted to

try {
   sh "${mvnHome}/bin/mvn -P!plugins -P!xtext-examples....
} finally {
   junit '**/TEST-*.xml'
}

?

yoosiba commented 6 years ago

Failing tests are subclasses of AbstractXjmTest. They do not fail in plain JUnit mode, but they sometimes fail when running as JUnit Plugin tests. When running as plugin test they depend on Xpect being activated in the platform. Some tests in the xpect.tests bundle have side effect of activating the Xpect, thus *Xjm test result actually depends on the test order:

For experiment remove from xpect.tests all tests that contain *.xt files, (i.e. org.eclipse.xpect.tests.expectation.impl, org.eclipse.xpect.tests.parameter, org.eclipse.xpect.tests.runner). Now when running the xpect.tests as JUnit Plugin tests in Eclipse, the XjmMethodsTest or XjmContributionsTest are red. Bringing back deleted tests sets makes them green again.

Commit https://github.com/eclipse/Xpect/pull/227/commits/6348cf6e554a0f47c4b82e5949d66d85f996447a ensures that Xpect is activated when running *Xjm tests.

yoosiba commented 6 years ago

P.S. I have temporarily adjusted config of the Xpect-Integration-Release to use this branch. This allowed to test the integration release and build. After merging I will switch Xpect-Integration-Release to use master branch.

yoosiba commented 6 years ago

@meysholdt branch seems to be fine now. Please review. Note adjusted tests setup.

meysholdt commented 6 years ago

The issue with plugin activation sounds similar to https://github.com/eclipse/Xpect/issues/198