Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/test/java/iq/BackwardsCompatibilityTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@

package iq;

import iq.base.AnnotationsTestsBase;
import org.apache.spark.SparkConf;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.rumbledb.config.RumbleRuntimeConfiguration;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

import scala.util.Properties;
import sparksoniq.spark.SparkSessionManager;
import utils.FileManager;
Expand All @@ -36,7 +37,7 @@
import java.util.*;

@RunWith(Parameterized.class)
public class BackwardsCompatibilityTests extends AnnotationsTestsBase {
public class BackwardsCompatibilityTests {

public static final File runtimeTestsDirectory = new File(
System.getProperty("user.dir")
Expand Down Expand Up @@ -106,13 +107,11 @@ public static void setupSparkSession() {

@Test(timeout = 1000000)
public final void testRuntimeIterators() throws Throwable {
System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
AnnotationsTestsBase.testAnnotations(
// System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
RumbleDBTestCommons.testAnnotations(
this.testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
true
);
}
}
15 changes: 7 additions & 8 deletions src/test/java/iq/Bugs.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package iq;

import iq.base.AnnotationsTestsBase;
import scala.Function0;
import scala.util.Properties;

Expand All @@ -29,6 +28,8 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

import sparksoniq.spark.SparkSessionManager;
import utils.FileManager;

Expand All @@ -38,7 +39,7 @@
import java.util.List;

@RunWith(Parameterized.class)
public class Bugs extends AnnotationsTestsBase {
public class Bugs {

public static final File runtimeTestsDirectory = new File(
System.getProperty("user.dir")
Expand Down Expand Up @@ -99,13 +100,11 @@ public static void setupSparkSession() {

@Test(timeout = 1000000)
public void testRuntimeIterators() throws Throwable {
System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
AnnotationsTestsBase.testAnnotations(
// System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
RumbleDBTestCommons.testAnnotations(
this.testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
RumbleDBTestCommons.getDefaultConfiguration(),
true
);
}
}
20 changes: 10 additions & 10 deletions src/test/java/iq/ComposabilityTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
package iq;


import iq.base.AnnotationsTestsBase;
import org.junit.Test;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

import java.util.List;

import java.io.File;


public class ComposabilityTests extends AnnotationsTestsBase {
public class ComposabilityTests {
public static final File composabilityTestsDirectory = new File(
System.getProperty("user.dir")
+
Expand All @@ -42,15 +44,13 @@ public class ComposabilityTests extends AnnotationsTestsBase {
*/
@Test(timeout = 1000000)
public void testComposabilityContraints() throws Throwable {
initializeTests(composabilityTestsDirectory);
for (File testFile : this.testFiles) {
System.err.println(counter++ + " : " + testFile);
testAnnotations(
List<File> testFiles = RumbleDBTestCommons.extractTestFilesFromDirectory(composabilityTestsDirectory);
for (File testFile : testFiles) {
// System.err.println(counter++ + " : " + testFile);
RumbleDBTestCommons.testAnnotations(
testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
RumbleDBTestCommons.getDefaultConfiguration(),
true
);
}
}
Expand Down
13 changes: 6 additions & 7 deletions src/test/java/iq/DeltaUpdateRuntimeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

package iq;

import iq.base.AnnotationsTestsBase;
import org.rumbledb.config.RumbleRuntimeConfiguration;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

import utils.annotations.AnnotationParseException;
import utils.annotations.AnnotationProcessor;
import org.apache.spark.SparkConf;
Expand All @@ -41,7 +42,7 @@
import java.util.*;

@RunWith(Parameterized.class)
public class DeltaUpdateRuntimeTests extends AnnotationsTestsBase {
public class DeltaUpdateRuntimeTests {

public static final File runtimeTestsDirectory = new File(
System.getProperty("user.dir")
Expand Down Expand Up @@ -180,7 +181,7 @@ public static void setupSparkSession() {

@Test(timeout = 1000000)
public void testRuntimeIterators() throws Throwable {
System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
// System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
try {
AnnotationProcessor.TestAnnotation currentAnnotation = AnnotationProcessor.readAnnotation(
new FileReader(this.testFile.getAbsolutePath())
Expand All @@ -189,12 +190,10 @@ public void testRuntimeIterators() throws Throwable {
e.printStackTrace();
Assert.fail();
}
testAnnotations(
RumbleDBTestCommons.testAnnotations(
this.testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
true
);
}

Expand Down
36 changes: 16 additions & 20 deletions src/test/java/iq/FrontendTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package iq;


import iq.base.AnnotationsTestsBase;
import org.junit.Assert;
import org.junit.Test;
import org.rumbledb.compiler.VisitorHelpers;
Expand All @@ -31,14 +30,15 @@
import org.rumbledb.expressions.module.MainModule;
import org.rumbledb.expressions.primary.VariableReferenceExpression;
import org.rumbledb.runtime.functions.input.FileSystemUtil;
import org.rumbledb.tests.commons.RumbleDBTestCommons;
import org.rumbledb.types.BuiltinTypesCatalogue;
import java.io.File;
import java.net.URI;
import java.util.Arrays;
import java.util.List;


public class FrontendTests extends AnnotationsTestsBase {
public class FrontendTests {

public static final File grammarTestsDirectory = new File(
System.getProperty("user.dir")
Expand All @@ -64,16 +64,14 @@ public class FrontendTests extends AnnotationsTestsBase {
*/
@Test(timeout = 1000000)
public void testGrammarAndParser() throws Throwable {
initializeTests(grammarTestsDirectory);
for (File testFile : this.testFiles) {
System.err.println(counter++ + " : " + testFile);
List<File> testFiles = RumbleDBTestCommons.extractTestFilesFromDirectory(grammarTestsDirectory);
for (File testFile : testFiles) {
// System.err.println(counter++ + " : " + testFile);
// FileReader reader = getReaderForFile(testFile.getAbsolutePath());
testAnnotations(
RumbleDBTestCommons.testAnnotations(
testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
RumbleDBTestCommons.getDefaultConfiguration(),
true
);
}

Expand Down Expand Up @@ -106,25 +104,23 @@ public void testGrammarAndParser() throws Throwable {
*/
@Test(timeout = 1000000)
public void testSematicChecks() throws Throwable {
initializeTests(semanticTestsDirectory);
for (File testFile : this.testFiles) {
System.err.println(counter++ + " : " + testFile);
testAnnotations(
List<File> testFiles = RumbleDBTestCommons.extractTestFilesFromDirectory(semanticTestsDirectory);
for (File testFile : testFiles) {
// System.err.println(counter++ + " : " + testFile);
RumbleDBTestCommons.testAnnotations(
testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
RumbleDBTestCommons.getDefaultConfiguration(),
true
);
if (Arrays.asList(manualSemanticChecksFiles).contains(testFile.getName())) {
URI uri = FileSystemUtil.resolveURIAgainstWorkingDirectory(
testFile.getAbsolutePath(),
getConfiguration(),
RumbleDBTestCommons.getDefaultConfiguration(),
ExceptionMetadata.EMPTY_METADATA
);
MainModule mainModule = VisitorHelpers.parseMainModuleFromLocation(
uri,
getConfiguration()
RumbleDBTestCommons.getDefaultConfiguration()
);

testVariableTypes(mainModule);
Expand Down
13 changes: 6 additions & 7 deletions src/test/java/iq/RuntimeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package iq;

import iq.base.AnnotationsTestsBase;
import scala.Function0;
import scala.util.Properties;

Expand All @@ -33,13 +32,15 @@
import org.rumbledb.config.RumbleRuntimeConfiguration;
import org.rumbledb.context.Name;
import org.rumbledb.items.ItemFactory;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

import sparksoniq.spark.SparkSessionManager;
import utils.FileManager;
import java.io.File;
import java.util.*;

@RunWith(Parameterized.class)
public class RuntimeTests extends AnnotationsTestsBase {
public class RuntimeTests {

public static final File runtimeTestsDirectory = new File(
System.getProperty("user.dir")
Expand Down Expand Up @@ -139,13 +140,11 @@ public static void setupSparkSession() {

@Test(timeout = 1000000)
public void testRuntimeIterators() throws Throwable {
System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
testAnnotations(
// System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
RumbleDBTestCommons.testAnnotations(
this.testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
true
);
}
}
11 changes: 4 additions & 7 deletions src/test/java/iq/RuntimeTestsNoInlining.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
import org.rumbledb.config.RumbleRuntimeConfiguration;
import org.rumbledb.context.Name;
import org.rumbledb.items.ItemFactory;

import iq.base.AnnotationsTestsBase;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

@RunWith(Parameterized.class)
public class RuntimeTestsNoInlining extends RuntimeTests {
Expand Down Expand Up @@ -79,13 +78,11 @@ public RumbleRuntimeConfiguration getConfiguration() {

@Test(timeout = 1000000)
public final void testRuntimeIterators() throws Throwable {
System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
testAnnotations(
// System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
RumbleDBTestCommons.testAnnotations(
this.testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
true
);
}
}
11 changes: 4 additions & 7 deletions src/test/java/iq/RuntimeTestsNoParallelism.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
import org.rumbledb.config.RumbleRuntimeConfiguration;
import org.rumbledb.context.Name;
import org.rumbledb.items.ItemFactory;

import iq.base.AnnotationsTestsBase;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

@RunWith(Parameterized.class)
public class RuntimeTestsNoParallelism extends RuntimeTests {
Expand Down Expand Up @@ -74,13 +73,11 @@ public RumbleRuntimeConfiguration getConfiguration() {

@Test(timeout = 1000000)
public final void testRuntimeIterators() throws Throwable {
System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
testAnnotations(
// System.err.println(AnnotationsTestsBase.counter++ + " : " + this.testFile);
RumbleDBTestCommons.testAnnotations(
this.testFile.getAbsolutePath(),
getConfiguration(),
true,
getConfiguration().applyUpdates(),
getConfiguration().getResultSizeCap()
true
);
}
}
15 changes: 8 additions & 7 deletions src/test/java/iq/SequentialClassificationTests.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package iq;

import iq.base.AnnotationsTestsBase;
import org.junit.Test;
import org.rumbledb.compiler.VisitorHelpers;
import org.rumbledb.exceptions.ExceptionMetadata;
Expand All @@ -26,26 +25,28 @@
import org.rumbledb.expressions.scripting.statement.Statement;
import org.rumbledb.expressions.scripting.statement.StatementsAndOptionalExpr;
import org.rumbledb.runtime.functions.input.FileSystemUtil;
import org.rumbledb.tests.commons.RumbleDBTestCommons;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class SequentialClassificationTests extends AnnotationsTestsBase {
public class SequentialClassificationTests {

private MainModule parseAndCompile(String filePath) throws IOException {
URI uri = FileSystemUtil.resolveURIAgainstWorkingDirectory(
filePath,
getConfiguration(),
RumbleDBTestCommons.getDefaultConfiguration(),
ExceptionMetadata.EMPTY_METADATA
);
return VisitorHelpers.parseMainModuleFromLocation(
uri,
getConfiguration()
RumbleDBTestCommons.getDefaultConfiguration()
);
}

Expand Down Expand Up @@ -292,9 +293,9 @@ public void testNonSequential() throws Throwable {
+
"/src/test/resources/test_files/sequential/non-sequential"
);
initializeTests(nonsequentialTestsDirectory);
for (File testFile : this.testFiles) {
System.err.println(counter++ + " : " + testFile);
List<File> testFiles = RumbleDBTestCommons.extractTestFilesFromDirectory(nonsequentialTestsDirectory);
for (File testFile : testFiles) {
// System.err.println(counter++ + " : " + testFile);
MainModule mainModule = parseAndCompile(testFile.getAbsolutePath());
for (Node descendant : mainModule.getDescendants()) {
if (descendant instanceof Expression) {
Expand Down
Loading