Can only run Unit Tests with Gurobi locally because of Licence

Dear Julia Discourse Optimization,

I can not run Unit Tests (Test.jl) with Gurobi, because CI.yml file and GitHub action don’t have a valid Gurobi Licence.

	@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:

	@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.

:blush:

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.

1 Like