Skip to content

Commit

Permalink
Upgrade Legend Pure to 5.0.0 (#2514)
Browse files Browse the repository at this point in the history
* Stable point

* Enable Relation Relational tests

* Rebase code and use legend pure last release
  • Loading branch information
pierredebelen authored Dec 20, 2023
1 parent b110eaf commit 3af032e
Show file tree
Hide file tree
Showing 71 changed files with 2,877 additions and 1,016 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
/legend-engine-xt-graphQL-grammar/gen/
/welcome.pure
/legend-engine-xt-nonrelationalStore-mongodb-grammar/gen/
/legend-engine-core-shared/legend-engine-shared-core/src/main/resources/legendExecutionVersion.json
/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/resources/legendExecutionVersion.json
temp
1 change: 1 addition & 0 deletions h2Console.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java -jar ~/.m2/repository/com/h2database/h2/2.1.214/h2-2.1.214.jar
2 changes: 1 addition & 1 deletion h2Server.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java -cp ~/.m2/repository/com/h2database/h2/1.4.200/h2-1.4.200.jar org.h2.tools.Server -tcp -tcpPort 9092 -ifNotExists
java -cp ~/.m2/repository/com/h2database/h2/2.1.214/h2-2.1.214.jar org.h2.tools.Server -tcp -tcpPort 1975 -ifNotExists
13 changes: 4 additions & 9 deletions legend-engine-config/legend-engine-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-pure-code-compiled-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-test-framework</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-sqlserver-pure</artifactId>
Expand Down Expand Up @@ -396,10 +400,6 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-executionPlan-execution-store-inMemory</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-executionPlan-connection</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-executionPlan</artifactId>
Expand Down Expand Up @@ -953,11 +953,6 @@
</dependency>
<!-- ANNOTATIONS -->

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>

<!-- RUNTIME -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import junit.framework.Test;
import junit.framework.TestSuite;
import org.finos.legend.engine.server.test.shared.PureTestHelper;
import org.finos.legend.engine.server.test.shared.PureWithEngineHelper;
import org.finos.legend.pure.m3.execution.test.TestCollection;
import org.finos.legend.pure.m4.coreinstance.CoreInstance;
Expand All @@ -25,6 +24,8 @@
import org.junit.Ignore;

import static org.finos.legend.engine.server.test.shared.PureTestHelper.wrapSuite;
import static org.finos.legend.engine.test.shared.framework.PureTestHelperFramework.buildJavaPureTestSuite;
import static org.finos.legend.engine.test.shared.framework.PureTestHelperFramework.getClassLoaderExecutionSupport;

@Ignore
public class Test_ExecutionPlan_JavaPlatform_CodeGeneration_UsingPureClient extends TestSuite
Expand All @@ -35,14 +36,16 @@ public static Test suite()
() -> PureWithEngineHelper.initClientVersionIfNotAlreadySet("vX_X_X"),
() ->
{
CompiledExecutionSupport executionSupport = PureTestHelper.getClassLoaderExecutionSupport();
CompiledExecutionSupport executionSupport = getClassLoaderExecutionSupport();
String func = "meta::pure::executionPlan::platformBinding::legendJava::tests::utils::javaPureTestWrapper_FunctionDefinition_1__Boolean_1_";
CoreInstance runner = executionSupport.getProcessorSupport().package_getByUserPath(func);
TestSuite suite = new TestSuite();
TestCollection testCollection = TestCollection.collectTests("meta::pure::executionPlan::platformBinding::legendJava::library::tests", executionSupport.getProcessorSupport(), fn -> PureTestBuilderCompiled.generatePureTestCollection(fn, executionSupport), null);
suite.addTest(PureTestHelper.buildJavaPureTestSuite(testCollection, executionSupport, runner));
suite.addTest(buildJavaPureTestSuite(testCollection, executionSupport, runner));
return suite;
});
},
PureWithEngineHelper::cleanUp
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport;

import static org.finos.legend.engine.server.test.shared.PureTestHelper.wrapSuite;
import static org.finos.legend.engine.test.shared.framework.PureTestHelperFramework.*;

public class Test_ExecutionPlan_JavaPlatform_UsingPureClient extends TestSuite
{
Expand All @@ -31,10 +32,12 @@ public static Test suite()
() -> PureWithEngineHelper.initClientVersionIfNotAlreadySet("vX_X_X"),
() ->
{
CompiledExecutionSupport executionSupport = PureTestHelper.getClassLoaderExecutionSupport();
CompiledExecutionSupport executionSupport = getClassLoaderExecutionSupport();
TestSuite suite = new TestSuite();
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::pure::executionPlan::platformBinding::legendJava::library", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::pure::executionPlan::platformBinding::legendJava::library", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
return suite;
});
},
PureWithEngineHelper::cleanUp
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

import junit.framework.Test;
import junit.framework.TestSuite;
import org.finos.legend.engine.server.test.shared.PureTestHelper;
import org.finos.legend.engine.server.test.shared.PureWithEngineHelper;
import org.finos.legend.pure.m3.execution.test.TestCollection;
import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport;

import static org.finos.legend.engine.server.test.shared.PureTestHelper.wrapSuite;
import static org.finos.legend.engine.test.shared.framework.PureTestHelperFramework.*;

public class Test_Engine_UsingPureClient extends TestSuite
{
Expand All @@ -31,11 +31,13 @@ public static Test suite()
() -> PureWithEngineHelper.initClientVersionIfNotAlreadySet("vX_X_X"),
() ->
{
CompiledExecutionSupport executionSupport = PureTestHelper.getClassLoaderExecutionSupport();
CompiledExecutionSupport executionSupport = getClassLoaderExecutionSupport();
TestSuite suite = new TestSuite();
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::legend::test::handlers", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::legend::test::model", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::legend::test::handlers", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::legend::test::model", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
return suite;
});
},
PureWithEngineHelper::cleanUp
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.finos.legend.pure.m3.execution.test.TestCollection;
import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport;

import static org.finos.legend.engine.test.shared.framework.PureTestHelperFramework.*;

public class Test_ExternalFormat_UsingPureClientTestSuite
{
public static Test suite()
Expand All @@ -29,20 +31,21 @@ public static Test suite()
() -> PureWithEngineHelper.initClientVersionIfNotAlreadySet("vX_X_X"),
() ->
{
CompiledExecutionSupport executionSupport = PureTestHelper.getClassLoaderExecutionSupport();
CompiledExecutionSupport executionSupport = getClassLoaderExecutionSupport();
TestSuite suite = new TestSuite();
// NOTE: temporarily ignore these tests until we bring extensions back into Legend
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::format::avro", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::format::protobuf", executionSupport.getProcessorSupport(), ci -> !ci.getName().equals("transform_testClassWithMapToProtoBuf__Boolean_1_") && PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::format::rosetta", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::format::xml", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::format::yaml", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::format::avro", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::format::protobuf", executionSupport.getProcessorSupport(), ci -> !ci.getName().equals("transform_testClassWithMapToProtoBuf__Boolean_1_") && satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::format::rosetta", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::format::xml", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::format::yaml", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));

suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::language", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::format::shared", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::external::store", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::language", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::format::shared", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::external::store", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
return suite;
}
},
PureWithEngineHelper::cleanUp
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import junit.framework.TestSuite;
import org.finos.legend.engine.server.test.shared.PureTestHelper;
import org.finos.legend.engine.server.test.shared.PureWithEngineHelper;
import org.finos.legend.engine.test.shared.framework.PureTestHelperFramework;
import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport;

public class Test_LoadMappings_UsingPureClient extends TestSuite
Expand All @@ -28,12 +29,13 @@ public static Test suite()
() -> PureWithEngineHelper.initClientVersionIfNotAlreadySet("vX_X_X"),
() ->
{
CompiledExecutionSupport executionSupport = PureTestHelper.getClassLoaderExecutionSupport();
CompiledExecutionSupport executionSupport = PureTestHelperFramework.getClassLoaderExecutionSupport();
TestSuite suite = new TestSuite();
// NOTE: temporarily ignore these tests until we bring extensions back into Legend
// suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::alloy::test::mapping", executionSupport.getProcessorSupport(), ci -> PureTestHelper.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
return suite;
}
},
PureWithEngineHelper::cleanUp
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

import junit.framework.Test;
import junit.framework.TestSuite;
import org.finos.legend.engine.server.test.shared.PureTestHelper;
import org.finos.legend.engine.server.test.shared.PureWithEngineHelper;
import org.finos.legend.pure.m3.execution.test.TestCollection;
import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport;

import static org.finos.legend.engine.server.test.shared.PureTestHelper.getClassLoaderExecutionSupport;
import static org.finos.legend.engine.server.test.shared.PureTestHelper.satisfiesConditions;
import static org.finos.legend.engine.server.test.shared.PureTestHelper.wrapSuite;
import static org.finos.legend.engine.test.shared.framework.PureTestHelperFramework.*;

public class Test_M2M_UsingPureClientTestSuite extends TestSuite
{
Expand All @@ -35,10 +33,11 @@ public static Test suite() throws Exception
{
CompiledExecutionSupport executionSupport = getClassLoaderExecutionSupport();
TestSuite suite = new TestSuite();
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::pure::mapping::modelToModel::test::alloy", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::pure::mapping::modelToModel::test::xmlStore", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(PureTestHelper.buildSuite(TestCollection.collectTests("meta::pure::graphFetch::tests::XStore::inMemory", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::pure::mapping::modelToModel::test::alloy", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::pure::mapping::modelToModel::test::xmlStore", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
suite.addTest(buildSuite(TestCollection.collectTests("meta::pure::graphFetch::tests::XStore::inMemory", executionSupport.getProcessorSupport(), ci -> satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport));
return suite;
});
},
PureWithEngineHelper::cleanUp);
}
}
Loading

0 comments on commit 3af032e

Please sign in to comment.