diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 234915b..aee1bea 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,7 +50,7 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 env: - MLFLOW_TRACKING_URI: "http://localhost:5000" + MLFLOW_API_URI: "http://localhost:5000/api" - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v2 with: diff --git a/src/types/mlflow.jl b/src/types/mlflow.jl index 2f32a39..640f8c2 100644 --- a/src/types/mlflow.jl +++ b/src/types/mlflow.jl @@ -12,7 +12,7 @@ Default is `false`, using the REST API endpoint. # Constructors - `MLFlow(apiroot; apiversion=2.0,headers=Dict())` -- `MLFlow()` - defaults to `MLFlow(ENV["MLFLOW_TRACKING_URI"])` or `MLFlow("http://localhost:5000")` +- `MLFlow()` - defaults to `MLFlow(ENV["MLFLOW_API_URI"])` or `MLFlow("http://localhost:5000")` # Examples @@ -34,8 +34,8 @@ end MLFlow(apiroot; apiversion=2.0, headers=Dict()) = MLFlow(apiroot, apiversion, headers) function MLFlow() apiroot = "http://localhost:5000/api" - if haskey(ENV, "MLFLOW_TRACKING_URI") - apiroot = ENV["MLFLOW_TRACKING_URI"] + if haskey(ENV, "MLFLOW_API_URI") + apiroot = ENV["MLFLOW_API_URI"] end return MLFlow(apiroot) end diff --git a/test/base.jl b/test/base.jl index 2561ed0..3fdf83a 100644 --- a/test/base.jl +++ b/test/base.jl @@ -13,7 +13,7 @@ function mlflow_server_is_running(mlf::MLFlow) end # creates an instance of mlf -# skips test if mlflow is not available on default location, ENV["MLFLOW_TRACKING_URI"] +# skips test if mlflow is not available on default location, ENV["MLFLOW_API_URI"] macro ensuremlf() e = quote mlf = MLFlow() diff --git a/test/runtests.jl b/test/runtests.jl index e68d247..401ac17 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,3 +1,7 @@ +if ~haskey(ENV, "MLFLOW_API_URI") + error("WARNING: MLFLOW_API_URI is not set. To run this tests, you need to set the URI of your MLFlow server API") +end + include("base.jl") include("test_functional.jl") diff --git a/test/test_functional.jl b/test/test_functional.jl index 400ba06..0e64fa0 100644 --- a/test/test_functional.jl +++ b/test/test_functional.jl @@ -1,6 +1,6 @@ @testset "MLFlow" begin mlf = MLFlow() - @test mlf.apiroot == ENV["MLFLOW_TRACKING_URI"] + @test mlf.apiroot == ENV["MLFLOW_API_URI"] @test mlf.apiversion == 2.0 @test mlf.headers == Dict() mlf = MLFlow("https://localhost:5001/api", apiversion=3.0)