Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 471547

Summary: Convert a significant part of our test fixtures to use AQL
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Cedric Brun <cedric.brun>
Status: CLOSED FIXED QA Contact: Vincent Richard <vincent.richard>
Severity: major    
Priority: P1 CC: maxime.porhel, vincent.richard
Version: 3.0.0Keywords: triaged
Target Milestone: 3.1.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/49889
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=329579570565635ae8ef6fd080a2e3309c0ab155
https://git.eclipse.org/r/54664
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=be1728d240339b637e9ff1974d7cdf342df2b5c4
Whiteboard:
Bug Depends on:    
Bug Blocks: 470460    
Attachments:
Description Flags
.queryrewriter model used to capture the translation none

Description Pierre-Charles David CLA 2015-07-01 04:38:56 EDT
Currently most of our automated tests use VSMs which rely on the old "Query Legacy" language. Some of them also use Acceleo 3/MTL, and an even smaller subset use var:/feature/service:. With the notable exception of interactions.odesign, very few tests exercise AQL.

This ticket is about converting large parts of our tests to use AQL instead of the deprecated "query legacy", both to help stabilize AQL and to progress towards the removal of "query legacy" (not in the short term, but one has to start).

The main issue is: how for do we go for 3.1? Aside from the time needed for the conversion itself, one has to take into account:
* the risks of finding and fixing bugs in AQL;
* the fact that one of our largest user, Capella, still relies almost exclusively on Query Legacy for their VSMs. We must keep enough of our tests on query legacy for the time being, to ensure it continues to work as expected.
Comment 1 Eclipse Genie CLA 2015-08-26 03:45:28 EDT
WARNING: this patchset contains 2877 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 3 Eclipse Genie CLA 2015-08-27 05:22:59 EDT
New Gerrit change created: https://git.eclipse.org/r/54664
Comment 5 Cedric Brun CLA 2015-08-31 05:46:45 EDT
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/54664 was merged to [master].
> Commit:
> http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/
> ?id=be1728d240339b637e9ff1974d7cdf342df2b5c4

This commit brings the migration of legacy expressions to 97%, about 20 expressions are not migrated because either :
- the expression is using nSort and AQL still lack sortedBy() (see Bug 473069)
- the expression is using current("SomeType") and requires a deeper understanding and specific tests

Note that the source code of the tests itself is still using the legacy interpreter through expressions which are computed as strings. Searching for "<%" in the source code brings 303 matches). This means the plugin is not quite ready to drop its dependency on the legacy interpreter but this amount of use of AQL is enough to close this ticket IMO.

Note also that migrating the swtbot tests looks like something we could be achieved quite easily as we need to migrate about 50 expressions in additions to those already migrated for JUnit and only 9 matches for "<%" in the source code.
Comment 6 Cedric Brun CLA 2015-08-31 05:50:29 EDT
Created attachment 256245 [details]
.queryrewriter model used to capture the translation

Model to be used with the tooling https://github.com/cbrun/sirius-query-rewriter and capturing the migration rules.
Comment 7 Vincent Richard CLA 2015-09-29 05:45:22 EDT
No validation: Technical issue
Comment 8 Cedric Brun CLA 2015-10-02 05:19:28 EDT
(In reply to Cedric Brun from comment #5)
> (In reply to Eclipse Genie from comment #4)
> > Gerrit change https://git.eclipse.org/r/54664 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/
> > ?id=be1728d240339b637e9ff1974d7cdf342df2b5c4
> 
> This commit brings the migration of legacy expressions to 97%, about 20
> expressions are not migrated because either :
> - the expression is using nSort and AQL still lack sortedBy() (see Bug
> 473069)
> - the expression is using current("SomeType") and requires a deeper
> understanding and specific tests
> 
> Note that the source code of the tests itself is still using the legacy
> interpreter through expressions which are computed as strings. Searching for
> "<%" in the source code brings 303 matches). This means the plugin is not
> quite ready to drop its dependency on the legacy interpreter but this amount
> of use of AQL is enough to close this ticket IMO.
> 
> Note also that migrating the swtbot tests looks like something we could be
> achieved quite easily as we need to migrate about 50 expressions in
> additions to those already migrated for JUnit and only 9 matches for "<%" in
> the source code.

The work which is remaining to completely remove the dependency is tracked in Bug 478878
Comment 9 Pierre-Charles David CLA 2015-10-16 09:11:38 EDT
Available in Sirius 3.1.0.