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
28 changes: 28 additions & 0 deletions .github/workflows/compiled-queries-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Compiled Queries CI

on:
push:
pull_request:

jobs:
compiled-queries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: oracle
java-version: "25"
cache: maven

- name: Install test-data tools
run: sudo apt-get update && sudo apt-get install -y wget zstd

- name: Install estore and test the codegen plugin
run: |
mvn -pl estore -am install -DskipTests -Djacoco.skip=true
mvn -pl estore-maven-plugin install

- name: Rewrite @CompileQuery tests and run them
run: mvn -f estore -Pcompile-queries clean test -Djacoco.skip=true -Dtest='Transformed*'
6 changes: 0 additions & 6 deletions .github/workflows/coverage-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,5 @@ jobs:
- name: Install test-data tools
run: sudo apt-get update && sudo apt-get install -y wget zstd

- name: Install codegen plugin
run: mvn -pl estore-maven-plugin -am install -DskipTests -Djacoco.skip=true

- name: Rewrite annotated queries
run: mvn -pl estore org.estore:estore-maven-plugin:1.0-SNAPSHOT:codegen

- name: Check coverage
run: mvn -pl estore clean test jacoco:report jacoco:check
6 changes: 0 additions & 6 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
- name: Install test-data tools
run: sudo apt-get update && sudo apt-get install -y wget zstd

- name: Install codegen plugin
run: mvn -pl estore-maven-plugin -am install -DskipTests -Djacoco.skip=true

- name: Rewrite annotated queries
run: mvn -pl estore org.estore:estore-maven-plugin:1.0-SNAPSHOT:codegen

- name: Build and test estore
run: mvn -pl estore clean test jacoco:report

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ eval/libs/*.jar
# data
data/

# Codegen files
Transformed*Test.java

# Local agent instructions (not committed)
AGENTS.md
.cursor/
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ mvn -pl estore test verify

The JaCoCo code coverage report is generated at `estore/target/site/jacoco/index.html`.

#### Run Tests with Compiled Queries

For now, `@CompileQuery` is for test methods only: the codegen plugin scans the test sources
(`estore/src/test/java`) and ignores the annotation anywhere else. For each test class with
annotated methods, the `compile-queries` profile generates a `Transformed<Name>Test.java` under
`estore/target/generated-test-sources/compiled-queries`, where those methods' Cypher queries are
compiled to Java. The build fails if a query cannot be compiled.

The codegen plugin depends on `estore`, so install both first, then build the `estore` POM
directly:

```bash
mvn -pl estore -am install -DskipTests && mvn -pl estore-maven-plugin install
mvn -f estore -Pcompile-queries test
```

#### Run the Application

Start the estore server and query it over the network:
Expand Down
12 changes: 4 additions & 8 deletions estore-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@
<version>1.0.0</version>
</dependency>
<dependency>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good catch, but can we have this in a separate PR
the entire dependency change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #11

<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-symbol-solver-core</artifactId>
<version>3.26.1</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down
Loading