lostluck commented on code in PR #33236: URL: https://github.com/apache/beam/pull/33236#discussion_r2083652159
########## sdks/go/pkg/beam/io/filesystem/gcs/gcs_test.go: ########## @@ -43,6 +44,21 @@ func TestGCS_FilesystemNew(t *testing.T) { } func TestGCS_direct(t *testing.T) { + testGCS_direct(t) +} + +func TestGCS_BillingProjectHookEnable(t *testing.T) { + billingProject := "whatever" + RequesterBillingProject(billingProject) + _, err := hooks.RunInitHooks(context.Background()) + if err != nil { + t.Errorf("error to init hooks = %v", err) + } + //TODO how assert project configured by hook? Review Comment: Call: hooks.IsEnabled. It will return if the hook is enabled, and the options that were set. https://pkg.go.dev/github.com/apache/beam/sdks/v2@v2.64.0/go/pkg/beam/core/util/hooks#IsEnabled ########## sdks/go/pkg/beam/core/runtime/harness/file_system_hooks.go: ########## @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package harness Review Comment: Don't put this into the harness package. It can live in the GCS package, registered to the the hook. The harness already triggers hooks on worker startup. harnessopts does things in the harness package because they're options for the harness, but that separation doesn't need to exist for the gcs package. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org