diff --git a/master/internal/configpolicy/task_config_policy_intg_test.go b/master/internal/configpolicy/task_config_policy_intg_test.go index 3c84a57dc33..ae19901868e 100644 --- a/master/internal/configpolicy/task_config_policy_intg_test.go +++ b/master/internal/configpolicy/task_config_policy_intg_test.go @@ -946,7 +946,24 @@ func testMergeSlicesAndMaps(t *testing.T) { userPartialInvariantConfig) require.NoError(t, err) - require.Equal(t, mergedWkspInvariantConfig, *res) + require.ElementsMatch(t, mergedWkspInvariantConfig.Data(), res.Data()) + require.Equal(t, mergedWkspInvariantConfig.Description(), res.Description()) + require.Equal(t, mergedWkspInvariantConfig.Resources().Slots(), res.Resources().Slots()) + require.ElementsMatch(t, mergedWkspInvariantConfig.Resources().Devices(), + res.Resources().Devices()) + require.Equal(t, mergedWkspInvariantConfig.PreemptionTimeout(), + res.PreemptionTimeout()) + require.ElementsMatch(t, mergedWkspInvariantConfig.BindMounts(), res.BindMounts()) + require.ElementsMatch(t, mergedWkspInvariantConfig.Environment().EnvironmentVariables().CPU(), + res.Environment().EnvironmentVariables().CPU()) + require.ElementsMatch(t, mergedWkspInvariantConfig.Environment().EnvironmentVariables().CUDA(), + res.Environment().EnvironmentVariables().CUDA()) + require.ElementsMatch(t, mergedWkspInvariantConfig.Environment().EnvironmentVariables().ROCM(), + res.Environment().EnvironmentVariables().ROCM()) + require.ElementsMatch(t, mergedWkspInvariantConfig.BindMounts(), res.BindMounts()) + require.ElementsMatch(t, mergedWkspInvariantConfig.Environment().ProxyPorts(), + res.Environment().ProxyPorts()) + require.ElementsMatch(t, mergedWkspInvariantConfig.LogPolicies(), res.LogPolicies()) // Merge user-submitted config with workspace and global config policies. setConfigPolicies(ctx, t, &w.ID, &model.TaskConfigPolicies{ @@ -975,7 +992,24 @@ func testMergeSlicesAndMaps(t *testing.T) { userPartialInvariantConfig) require.NoError(t, err) - require.Equal(t, mergedGlobalInvariantConfig, *res) + require.ElementsMatch(t, mergedGlobalInvariantConfig.Data(), res.Data()) + require.Equal(t, mergedGlobalInvariantConfig.Description(), res.Description()) + require.Equal(t, mergedGlobalInvariantConfig.Resources().Slots(), res.Resources().Slots()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.Resources().Devices(), + res.Resources().Devices()) + require.Equal(t, mergedGlobalInvariantConfig.PreemptionTimeout(), + res.PreemptionTimeout()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.BindMounts(), res.BindMounts()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.Environment().EnvironmentVariables().CPU(), + res.Environment().EnvironmentVariables().CPU()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.Environment().EnvironmentVariables().CUDA(), + res.Environment().EnvironmentVariables().CUDA()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.Environment().EnvironmentVariables().ROCM(), + res.Environment().EnvironmentVariables().ROCM()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.BindMounts(), res.BindMounts()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.Environment().ProxyPorts(), + res.Environment().ProxyPorts()) + require.ElementsMatch(t, mergedGlobalInvariantConfig.LogPolicies(), res.LogPolicies()) }) }