From 480f014dbc08d4940a6cbe70830cf268eae3c45b Mon Sep 17 00:00:00 2001 From: Owen Lynch Date: Tue, 9 Apr 2024 12:00:48 -0700 Subject: [PATCH 1/3] clean up test: don't require acsets4j submodule --- .gitmodules | 3 --- test/intertypes/InterTypes.jl | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 86c3a61..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "test/intertypes/acsets4j"] - path = test/intertypes/acsets4j - url = git@github.com:AlgebraicJulia/acsets4j diff --git a/test/intertypes/InterTypes.jl b/test/intertypes/InterTypes.jl index 5c2245f..6271fb3 100644 --- a/test/intertypes/InterTypes.jl +++ b/test/intertypes/InterTypes.jl @@ -52,6 +52,8 @@ simpleast_schema = JSONSchema.Schema(read("simpleast_schema.json", String)) @test JSONSchema._validate(simpleast_schema, JSON.parse(s), "Term") === nothing +rm("simpleast_schema.json") + @intertypes "model.it" module model import ..simpleast end @@ -87,6 +89,8 @@ wgraph_schema = JSONSchema.Schema(read("wgraph_schema.json", String)) @test JSONSchema._validate(wgraph_schema, JSON.parse(JSON3.write(g)), "EDWeightedGraph") === nothing +rm("wgraph_schema.json") + @intertypes "objects.it" module objects end using .objects @@ -104,6 +108,8 @@ objects_schema = JSONSchema.Schema(read("objects_schema.json", String)) @test JSONSchema._validate(objects_schema, JSON.parse(JSON3.write(md)), "Metadata") === nothing +rm("objects_schema.json") + @intertypes "optionals.it" module optionals end using .optionals @@ -127,6 +133,8 @@ optionals_schema = JSONSchema.Schema(read("optionals_schema.json", String)) @test JSONSchema._validate(optionals_schema, JSON.parse(JSON3.write(x)), "NullableInt") === nothing @test JSONSchema._validate(optionals_schema, JSON.parse(JSON3.write(y)), "NullableInt") === nothing +rm("optionals_schema.json") + # Python Integration Tests @static if !Sys.iswindows() @@ -186,19 +194,18 @@ if hasgradle generate_module(model, JacksonTarget, java_dir) generate_module(wgraph, JacksonTarget, java_dir) - cd(joinpath(@__DIR__, "acsets4j")) - run(`gradle build`) - cd("..") - mkpath("java/libs") - jar_source = "acsets4j/lib/build/libs/acsets4j-0.1.jar" jar_dest = "java/lib/deps/acsets4j-0.1.jar" + jar_source = "https://github.com/AlgebraicJulia/acsets4j/files/14922802/acsets4j-0.1.zip" if isfile(jar_dest) rm(jar_dest) end mkpath("java/lib/deps") - cp(jar_source, jar_dest) + + run(`curl -L $jar_source --output acsets4j-0.1.zip`) + run(`unzip acsets4j-0.1.zip -d java/lib/deps/`) + run(`rm acsets4j-0.1.zip`) cd(joinpath(@__DIR__, "java")) run(`gradle build`) From 45d5213291f8f9f95aa5ce276596e189ccc7abe5 Mon Sep 17 00:00:00 2001 From: Owen Lynch Date: Tue, 9 Apr 2024 12:23:55 -0700 Subject: [PATCH 2/3] removed submodule for real now --- test/intertypes/acsets4j | 1 - 1 file changed, 1 deletion(-) delete mode 160000 test/intertypes/acsets4j diff --git a/test/intertypes/acsets4j b/test/intertypes/acsets4j deleted file mode 160000 index 360a2df..0000000 --- a/test/intertypes/acsets4j +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 360a2df893092c44506046426ea04b9438de70b5 From d3b3988f0b789ab4dc75c00ace1610aa8b5b2d69 Mon Sep 17 00:00:00 2001 From: Owen Lynch Date: Tue, 9 Apr 2024 12:46:26 -0700 Subject: [PATCH 3/3] cd into the right directory before downloading jar --- test/intertypes/InterTypes.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/intertypes/InterTypes.jl b/test/intertypes/InterTypes.jl index 6271fb3..85b2f05 100644 --- a/test/intertypes/InterTypes.jl +++ b/test/intertypes/InterTypes.jl @@ -189,7 +189,9 @@ catch error end if hasgradle - java_dir = joinpath(@__DIR__, "java/lib/src/main/java") + cd(@__DIR__) + + java_dir = "java/lib/src/main/java" generate_module(simpleast, JacksonTarget, java_dir) generate_module(model, JacksonTarget, java_dir) generate_module(wgraph, JacksonTarget, java_dir) @@ -207,7 +209,7 @@ if hasgradle run(`unzip acsets4j-0.1.zip -d java/lib/deps/`) run(`rm acsets4j-0.1.zip`) - cd(joinpath(@__DIR__, "java")) + cd("java") run(`gradle build`) cd("..")