The GitHub Actions job "GraphAr Java Info CI" on
incubator-graphar.git/feat/java-info-unit-tests has failed.
Run started by GitHub user Thespica (triggered by Thespica).
Head commit for run:
3eaa38aba4bbc0a941faafce716d288db336f48a / google-labs-jules[bot]
<161369871+google-labs-jules[bot]@users.noreply.github.com>
fix: Correct GraphInfo prefix loading and test assertions
This commit addresses several issues related to unit tests in the java-info
module:
1. **GraphInfo Prefix Handling (in LocalYamlGraphLoader.java)**:
* I modified `LocalYamlGraphLoader.load()` to correctly determine and set
the `prefix` for a `GraphInfo` object.
* If the `prefix` is missing or empty in the `graph.yml` file, it now
defaults to the absolute path of the directory containing the `graph.yml` file,
ensuring a trailing slash.
* If a `prefix` is specified in `graph.yml`, I resolved it relative to
the `graph.yml` file's location and normalized it (also ensuring a trailing
slash).
2. **GraphInfo Prefix Test (in InfoTest.java)**:
* I corrected the `expectedPrefix` calculation in `testLoadGraphInfo()`
to align with the updated loader logic. The test now correctly expects the
`GraphInfo.prefix` to be the directory of the loaded `graph.yml` file when the
YAML does not specify a prefix.
3. **EdgeInfo Constructor Parameter Reordering**:
* I changed the `EdgeInfo` constructor parameter order for chunk sizes
from `(..., chunkSize, srcChunkSize, dstChunkSize, ...)` to `(...,
srcChunkSize, edgeChunkSize, dstChunkSize, ...)`, where `edgeChunkSize`
corresponds to the original `chunkSize`.
* I updated `EdgeYaml.toEdgeInfo()` to match this new constructor
signature.
* I updated `TestUtil.getLdbcSampleDataSet()` to use the new constructor
order when creating `EdgeInfo` instances.
* I reviewed assertions in `InfoTest.testLoadEdgeInfo()` related to chunk
sizes; no changes were needed as the getters correctly reflected the reordered
parameters.
4. **Compilation Error Fixes (in InfoTest.java)**:
* I added missing imports for `DataType`, `FileType`, and `AdjListType`
from `org.apache.graphar.proto`.
* I corrected method calls: `PropertyGroup.getProperties()` to
`PropertyGroup.getPropertyList()`, `Property.isIs_primary()` to
`Property.isPrimary()`, and `*.getFile_type()` to `*.getFileType()`.
5. **Spotless Formatting**:
* I applied `mvn spotless:apply` to the `java-info` module to resolve
formatting violations.
**Remaining Issues & Analysis of Test Failures**:
Despite the above fixes, your previous feedback indicated several persistent
test failures:
- `InfoTest.testLoadGraphInfo:55` (This should now be resolved by items 1 &
2 above).
- `InfoTest.testLoadEdgeInfo:219` (Asserting DataType.STRING for
"creationDate")
- `InfoTest.testLoadVertexInfo:138` (Asserting DataType.INT64 for "id")
- `InfoTest.testProperty:535` (Equality check for a Property object,
depends on DataType)
- `InfoTest.testPropertyGroup:304` (Asserting DataType.INT64 for loaded
"id" property)
These remaining failures consistently point to an issue where the `DataType`
enum obtained from loaded `VertexInfo` or `EdgeInfo` objects does not match the
expected `DataType` enum in the assertions (e.g., `DataType.INT64` or
`DataType.STRING`).
I performed extensive analysis:
- The YAML files (`person.vertex.yml`, `person_knows_person.edge.yml`)
correctly specify `data_type` strings (e.g., "int64", "string").
- The `EnumTransferUtil.string2DataType()` method correctly converts these
strings to the corresponding `org.apache.graphar.proto.DataType` enums.
- The `Property` class stores and returns these enums correctly.
- Imports for `DataType` in `InfoTest.java` are correct.
The root cause for these `DataType` mismatches remains elusive. The code logic
for loading, converting, and accessing these types appears sound. Possible
unexplored avenues could be subtle classpath/build issues or a deeper logic
error in how property data is structured or retrieved that was not apparent
from static code analysis. Further debugging with runtime information (e.g.,
printing the actual enum values being returned) would be necessary to pinpoint
the exact cause of these specific `DataType` assertion failures.
Report URL: https://github.com/apache/incubator-graphar/actions/runs/15215583489
With regards,
GitHub Actions via GitBox
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]