Mentions légales du service

Skip to content
Snippets Groups Projects
Commit bff27b5d authored by Jonathan Pastor's avatar Jonathan Pastor
Browse files

implement a spec test for generator expecting no value

parent da21c2bd
No related branches found
No related tags found
1 merge request!6WIP: Features/oar gpus
...@@ -2110,6 +2110,42 @@ GeForce RTX 2080 Ti ...@@ -2110,6 +2110,42 @@ GeForce RTX 2080 Ti
expect(generator_output[:stdout]).to include(expected_output) expect(generator_output[:stdout]).to include(expected_output)
expect(generator_output[:stdout]).not_to include(not_expected_output) expect(generator_output[:stdout]).not_to include(not_expected_output)
end end
it 'should ignore the GPUs' do
uri = URI(conf["uri"])
response = Net::HTTP.get(uri)
expect(response).to be_an_instance_of(String)
options = {
:table => false,
:print => false,
:update => false,
:diff => true,
:site => "fakesite",
:clusters => ["clustera"],
:verbose => 2
}
expected_output = <<-TXT
# Error: Resource 1 (host=clustera-1.fakesite.grid5000.fr cpu=1 core=1 cpuset=0 gpu=1 gpudevice=0) has a mismatch for ressource GPU: OAR API gives 1, generator wants ø.
# Error: Resource 1 (host=clustera-1.fakesite.grid5000.fr cpu=1 core=1 cpuset=0 gpu=1 gpudevice=0) has a mismatch for ressource GPUDEVICE: OAR API gives 0, generator wants ø.
# Error: Resource 2 (host=clustera-1.fakesite.grid5000.fr cpu=1 core=2 cpuset=1 gpu=1 gpudevice=0) has a mismatch for ressource GPU: OAR API gives 1, generator wants ø.
TXT
not_expected_output = <<-TXT
GeForce RTX 2080 Ti
TXT
generator_output = capture do
generate_oar_properties(options)
end
expect(generator_output[:stdout]).to include(expected_output)
expect(generator_output[:stdout]).not_to include(not_expected_output)
end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment