Skip to content

chore(modelarmor): enabled floor settings tests #5345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions modelarmor/modelarmor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import (
grpcstatus "google.golang.org/grpc/status"
)

// TODO: Floorsettings test cases will be added later

// testLocation retrieves the GOLANG_SAMPLES_LOCATION environment variable
// used to determine the region for running the test.
// Skip the test if the environment variable is not set.
Expand Down Expand Up @@ -1297,8 +1295,6 @@ func TestUpdateTemplateWithMaskConfiguration(t *testing.T) {
// TestGetProjectFloorSettings tests the retrieval of floor settings at the project level.
// It verifies the output contains the expected confirmation string.
func TestGetProjectFloorSettings(t *testing.T) {

t.Skip("TODO(b/424365799): Update this once the mentioned issue is resolved")
tc := testutil.SystemTest(t)

var buf bytes.Buffer
Expand All @@ -1314,7 +1310,6 @@ func TestGetProjectFloorSettings(t *testing.T) {
// TestGetOrganizationFloorSettings tests the retrieval of floor settings at the organization level.
// It checks that the output includes the expected string indicating success.
func TestGetOrganizationFloorSettings(t *testing.T) {
t.Skip("TODO(b/424365799): Update this once the mentioned issue is resolved")
organizationID := testOrganizationID(t)
var buf bytes.Buffer
if err := getOrganizationFloorSettings(&buf, organizationID); err != nil {
Expand All @@ -1329,7 +1324,6 @@ func TestGetOrganizationFloorSettings(t *testing.T) {
// TestGetFolderFloorSettings tests the retrieval of floor settings at the folder level.
// It ensures the result contains the expected confirmation message.
func TestGetFolderFloorSettings(t *testing.T) {
t.Skip("TODO(b/424365799): Update this once the mentioned issue is resolved")
folderID := testFolderID(t)
var buf bytes.Buffer
if err := getFolderFloorSettings(&buf, folderID); err != nil {
Expand All @@ -1344,7 +1338,6 @@ func TestGetFolderFloorSettings(t *testing.T) {
// TestUpdateFolderFloorSettings tests updating floor settings for a specific folder.
// It verifies that the output buffer contains a confirmation message indicating a successful update.
func TestUpdateFolderFloorSettings(t *testing.T) {
t.Skip("TODO(b/424365799): Update this once the mentioned issue is resolved")
folderID := testFolderID(t)
locationID := testLocation(t)
var buf bytes.Buffer
Expand All @@ -1364,7 +1357,6 @@ func TestUpdateFolderFloorSettings(t *testing.T) {
// TestUpdateOrganizationFloorSettings tests updating floor settings for a specific organization.
// It ensures the output buffer includes a success message confirming the update.
func TestUpdateOrganizationFloorSettings(t *testing.T) {
t.Skip("TODO(b/424365799): Update this once the mentioned issue is resolved")
organizationID := testOrganizationID(t)
locationID := testLocation(t)
var buf bytes.Buffer
Expand All @@ -1385,7 +1377,6 @@ func TestUpdateOrganizationFloorSettings(t *testing.T) {
// TestUpdateProjectFloorSettings tests updating floor settings for a specific project.
// It checks that the resulting output includes the expected confirmation message.
func TestUpdateProjectFloorSettings(t *testing.T) {
t.Skip("TODO(b/424365799): Update this once the mentioned issue is resolved")
tc := testutil.SystemTest(t)
locationID := testLocation(t)
var buf bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion modelarmor/update_folder_floor_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func updateFolderFloorSettings(w io.Writer, folderID, locationID string) error {
RaiFilters: []*modelarmorpb.RaiFilterSettings_RaiFilter{
{
FilterType: modelarmorpb.RaiFilterType_HATE_SPEECH,
ConfidenceLevel: modelarmorpb.DetectionConfidenceLevel_HIGH,
ConfidenceLevel: modelarmorpb.DetectionConfidenceLevel_LOW_AND_ABOVE,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion modelarmor/update_organization_floor_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func updateOrganizationFloorSettings(w io.Writer, organizationID, locationID str
RaiFilters: []*modelarmorpb.RaiFilterSettings_RaiFilter{
{
FilterType: modelarmorpb.RaiFilterType_HATE_SPEECH,
ConfidenceLevel: modelarmorpb.DetectionConfidenceLevel_HIGH,
ConfidenceLevel: modelarmorpb.DetectionConfidenceLevel_LOW_AND_ABOVE,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion modelarmor/update_project_floor_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func updateProjectFloorSettings(w io.Writer, projectID, locationID string) error
RaiFilters: []*modelarmorpb.RaiFilterSettings_RaiFilter{
{
FilterType: modelarmorpb.RaiFilterType_HATE_SPEECH,
ConfidenceLevel: modelarmorpb.DetectionConfidenceLevel_HIGH,
ConfidenceLevel: modelarmorpb.DetectionConfidenceLevel_LOW_AND_ABOVE,
},
},
},
Expand Down