# Can only run Unit Tests with Gurobi locally because of Licence

**URL:** https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169
**Category:** Optimization (Mathematical)
**Tags:** gurobi
**Created:** [July 18, 2024, 5:59am UTC](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169 "2024-07-18T05:59:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![K5Julien](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/k5julien/32/210626_2.png) [@K5Julien](https://discourse.julialang.org/u/K5Julien)
#### Post date: [July 18, 2024, 5:59am UTC](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169/1 "2024-07-18T05:59:37Z")

</div>

Dear Julia Discourse Optimization,

I can not run Unit Tests (Test.jl) with Gurobi, because [CI.yml file](https://github.com/jkhamphousone/RingStarProblems.jl/blob/main/.github/workflows/CI.yml) and GitHub action don’t have a valid Gurobi Licence.

```julia
	@test rspoptimize(pars, 1, optimizer_with_attributes(GLPK.Optimizer,
			"msg_lev" => GLPK.GLP_MSG_ALL,
			"tm_lim" => pars.timelimit),
		 true) == 0

	@test rspoptimize(pars, 1, optimizer_with_attributes(Gurobi.Optimizer,
				"TimeLimit" => pars.timelimit), true) == 0
	@test rspoptimize(pars, 3, optimizer_with_attributes(Gurobi.Optimizer,
				"TimeLimit" => pars.timelimit), true) == 0

```

My current (non-satisfying workaround) is:

```julia
	@test rspoptimize(pars, 1, optimizer_with_attributes(GLPK.Optimizer,
			"msg_lev" => GLPK.GLP_MSG_ALL,
			"tm_lim" => pars.timelimit),
		 true) == 0
	gurobilocal = false
	if gurobilocal
	 
    @test rspoptimize(pars, 1, optimizer_with_attributes(Gurobi.Optimizer,
				"TimeLimit" => pars.timelimit), true) == 0
	@test rspoptimize(pars, 3, optimizer_with_attributes(Gurobi.Optimizer,
				"TimeLimit" => pars.timelimit), true) == 0
	end

```

I am able to run those test locally. Is that the correct way to do? Disabling the Gurobi tests before committing?

Please note that the GitHub action works with GLPK Unit tests.

😊

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [July 18, 2024, 7:10am UTC](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169/2 "2024-07-18T07:10:10Z")

</div>

The point of JuMP is that you shouldn’t need to explicitly test Gurobi.

If it works with GLPK, and the user can pass their own optimizer, then that’s enough.
