X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6c0bf267d795a3ca49c3258c9490714c9e18d333..b307cc4cf2f31eccd1ae5ef3310cfee309f6688e:/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go?ds=inline diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go index e7ccf25fc9..c9208a6943 100644 --- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go +++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go @@ -305,13 +305,25 @@ func (s *MockArvadosServerSuite) TestSbatchFuncWithConfigArgs(c *C) { func testSbatchFuncWithArgs(c *C, args []string) { theConfig.SbatchArguments = append(theConfig.SbatchArguments, args...) - container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 1000000, VCPUs: 2}} + container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 250000000, VCPUs: 2}} sbatchCmd := sbatchFunc(container) var expected []string expected = append(expected, "sbatch", "--share") expected = append(expected, theConfig.SbatchArguments...) - expected = append(expected, "--job-name=123", "--mem-per-cpu=1", "--cpus-per-task=2") + expected = append(expected, "--job-name=123", "--mem-per-cpu=120", "--cpus-per-task=2") + + c.Check(sbatchCmd.Args, DeepEquals, expected) +} + +func (s *MockArvadosServerSuite) TestSbatchPartition(c *C) { + theConfig.SbatchArguments = nil + container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 250000000, VCPUs: 1, Partition: []string{"blurb", "b2"}}} + sbatchCmd := sbatchFunc(container) + + var expected []string + expected = append(expected, "sbatch", "--share") + expected = append(expected, "--job-name=123", "--mem-per-cpu=239", "--cpus-per-task=1", "--partition=blurb,b2") c.Check(sbatchCmd.Args, DeepEquals, expected) }