Thespica commented on code in PR #683:
URL: https://github.com/apache/incubator-graphar/pull/683#discussion_r2110800669


##########
.github/workflows/info.yml:
##########
@@ -0,0 +1,85 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: GraphAr Info CI

Review Comment:
   maybe we can rename it to GraphAr Java-Info CI, also remind to rename file.



##########
.github/workflows/info.yml:
##########
@@ -0,0 +1,85 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: GraphAr Info CI
+
+on:
+  # Trigger the workflow on push or pull request,
+  # but only for the main branch
+  push:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/info/**'
+      - '.github/workflows/info.yml'
+  pull_request:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/info/**'
+      - '.github/workflows/info.yml'
+
+concurrency:
+  group: ${{ github.repository }}-${{ github.event.number || github.head_ref 
|| github.sha }}-${{ github.workflow }}
+  cancel-in-progress: true
+
+jobs:
+  test:
+    runs-on: ubuntu-22.04
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') && 
github.event.pull_request.draft == false }}
+    env:
+      GAR_TEST_DATA: ${{ github.workspace }}/graphar-testing/
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          submodules: true
+          
+      - name: Install dependencies
+        run: |
+          # install the latest arrow deb to test arrow
+          wget -c https://apache.jfrog.io/artifactory/arrow/"$(lsb_release 
--id --short | tr 'A-Z' 'a-z')"/apache-arrow-apt-source-latest-$(lsb_release 
--codename --short).deb \
+            -P /tmp/
+          sudo apt-get install -y 
/tmp/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
+          sudo apt-get update -y
+          # TODO: ISSUE-241
+          sudo apt install -y libarrow-dev=17.0.0-1 \
+                    libarrow-dataset-dev=17.0.0-1 \
+                    libarrow-acero-dev=17.0.0-1 \
+                    libparquet-dev=17.0.0-1 
+          sudo apt-get install -y libboost-graph-dev ccache 
libcurl4-openssl-dev doxygen lcov
+          sudo apt-get install llvm-11 clang-11 lld-11 libclang-11-dev 
libz-dev -y
+        
+          git clone https://github.com/apache/incubator-graphar-testing.git 
$GAR_TEST_DATA --depth 1
+
+      - name: Code Format Check
+        working-directory: maven-projects/info
+        run: |
+          export JAVA_HOME=${JAVA_HOME_11_X64}
+          mvn --no-transfer-progress spotless:check
+      
+      - name: Build Java Docs
+        working-directory: maven-projects/info
+        run: |
+          export JAVA_HOME=${JAVA_HOME_11_X64}
+          mvn --no-transfer-progress javadoc:javadoc
+
+      - name: Run test
+        working-directory: maven-projects/info
+        run: |
+          export JAVA_HOME=${JAVA_HOME_11_X64}
+          export LLVM11_HOME=/usr/lib/llvm-11

Review Comment:
   do not need `LLVM11_HOME`



##########
maven-projects/info/src/test/java/org/apache/graphar/info/GraphLoaderTest.java:
##########
@@ -41,21 +44,196 @@ public static void clean() {}
     public void testLoad() {
         final GraphLoader graphLoader = new LocalYamlGraphLoader();
         final String GRAPH_PATH = TestUtil.getLdbcSampleGraphPath();
+        GraphInfo graphInfo = null;
         try {
-            final GraphInfo graphInfo = graphLoader.load(GRAPH_PATH);
-            Assert.assertNotNull(graphInfo);
-            Assert.assertNotNull(graphInfo.getEdgeInfos());
-            Assert.assertEquals(1, graphInfo.getEdgeInfos().size());
-            for (EdgeInfo edgeInfo : graphInfo.getEdgeInfos()) {
-                Assert.assertNotNull(edgeInfo.getConcat());
-            }
-            Assert.assertNotNull(graphInfo.getVertexInfos());
-            Assert.assertEquals(1, graphInfo.getVertexInfos().size());
-            for (VertexInfo vertexInfo : graphInfo.getVertexInfos()) {
-                Assert.assertNotNull(vertexInfo.getType());
-            }
+            graphInfo = graphLoader.load(GRAPH_PATH);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
+        testGraphInfo(graphInfo);
+        testVertexInfo(graphInfo);
+        testEdgeInfo(graphInfo);
+    }
+
+    private void testGraphInfo(GraphInfo graphInfo) {
+        Assert.assertNotNull(graphInfo);
+        Assert.assertEquals("ldbc_sample", graphInfo.getName());
+        Assert.assertEquals("", graphInfo.getPrefix()); // is empty string?
+        Assert.assertNotNull(graphInfo.getEdgeInfos());
+        Assert.assertEquals(1, graphInfo.getEdgeInfos().size());
+        Assert.assertNotNull(graphInfo.getVertexInfos());
+        Assert.assertEquals(1, graphInfo.getVertexInfos().size());
+    }
+
+    private void testVertexInfo(GraphInfo graphInfo) {
+        VertexInfo personVertexInfo = graphInfo.getVertexInfos().get(0);
+        Assert.assertEquals("person", personVertexInfo.getType());
+        Assert.assertEquals(100, personVertexInfo.getChunkSize());
+        Assert.assertEquals("vertex/person/", personVertexInfo.getPrefix());
+        Assert.assertEquals(
+                "vertex/person//vertex_count",
+                personVertexInfo.getVerticesNumFilePath()); // one more '/'
+        Assert.assertEquals("vertex/person//person.vertex.yaml", 
personVertexInfo.getVertexPath());
+        Assert.assertNotNull(personVertexInfo.getPropertyGroups());
+        Assert.assertEquals(2, personVertexInfo.getPropertyGroups().size());

Review Comment:
   can we refactor the test context and make it more clear? (not only for 
`testVertexInfo`)



##########
.github/workflows/info.yml:
##########
@@ -0,0 +1,85 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: GraphAr Info CI
+
+on:
+  # Trigger the workflow on push or pull request,
+  # but only for the main branch
+  push:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/info/**'
+      - '.github/workflows/info.yml'
+  pull_request:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/info/**'
+      - '.github/workflows/info.yml'
+
+concurrency:
+  group: ${{ github.repository }}-${{ github.event.number || github.head_ref 
|| github.sha }}-${{ github.workflow }}
+  cancel-in-progress: true
+
+jobs:
+  test:
+    runs-on: ubuntu-22.04
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') && 
github.event.pull_request.draft == false }}

Review Comment:
   allow running for draft PR



##########
.github/workflows/info.yml:
##########
@@ -0,0 +1,85 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: GraphAr Info CI
+
+on:
+  # Trigger the workflow on push or pull request,
+  # but only for the main branch
+  push:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/info/**'
+      - '.github/workflows/info.yml'
+  pull_request:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/info/**'
+      - '.github/workflows/info.yml'
+
+concurrency:
+  group: ${{ github.repository }}-${{ github.event.number || github.head_ref 
|| github.sha }}-${{ github.workflow }}
+  cancel-in-progress: true
+
+jobs:
+  test:
+    runs-on: ubuntu-22.04
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') && 
github.event.pull_request.draft == false }}
+    env:
+      GAR_TEST_DATA: ${{ github.workspace }}/graphar-testing/
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          submodules: true
+          
+      - name: Install dependencies
+        run: |
+          # install the latest arrow deb to test arrow
+          wget -c https://apache.jfrog.io/artifactory/arrow/"$(lsb_release 
--id --short | tr 'A-Z' 'a-z')"/apache-arrow-apt-source-latest-$(lsb_release 
--codename --short).deb \
+            -P /tmp/
+          sudo apt-get install -y 
/tmp/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
+          sudo apt-get update -y
+          # TODO: ISSUE-241
+          sudo apt install -y libarrow-dev=17.0.0-1 \
+                    libarrow-dataset-dev=17.0.0-1 \
+                    libarrow-acero-dev=17.0.0-1 \
+                    libparquet-dev=17.0.0-1 
+          sudo apt-get install -y libboost-graph-dev ccache 
libcurl4-openssl-dev doxygen lcov
+          sudo apt-get install llvm-11 clang-11 lld-11 libclang-11-dev 
libz-dev -y

Review Comment:
   do not need arrow or llvm or others dependencies here, the java-info module 
is implemented by pure java



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org
For additional commands, e-mail: commits-h...@graphar.apache.org

Reply via email to