Skip to content
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

Rename & move to tractoai testcontainers #22

Merged
merged 2 commits into from
Jun 6, 2024
Merged
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
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ run:

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
format: colored-line-number
formats:
- # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand Down Expand Up @@ -110,7 +111,7 @@ linters-settings:

staticcheck:
# Select the Go version to target. The default is '1.13'.
go: 1.20.0
go: 1.22.0
checks: # default checks from https://staticcheck.io/docs/configuration/options/ + excluded SA1019
- all
- -ST1000 # Incorrect or missing package comment
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# ytsaurus-active-directory-integration
# ytsaurus-identity-sync
22 changes: 13 additions & 9 deletions app_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
ytcontainer "github.com/nebius/testcontainers-ytsaurus"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
ytcontainer "github.com/tractoai/testcontainers-ytsaurus"
"go.ytsaurus.tech/yt/go/ypath"
"go.ytsaurus.tech/yt/go/yt"
"k8s.io/utils/clock"
Expand Down Expand Up @@ -71,7 +71,7 @@ var (

type AppTestSuite struct {
suite.Suite
ytsaurusLocal *ytcontainer.YtsaurusLocal
ytsaurusLocal *ytcontainer.YTsaurusContainer
ytsaurusClient yt.Client
initialYtsaurusUsers []YtsaurusUser
initialYtsaurusGroups []YtsaurusGroupWithMembers
Expand All @@ -82,18 +82,18 @@ type AppTestSuite struct {

func (suite *AppTestSuite) SetupSuite() {
suite.ctx = context.Background()
suite.ytsaurusLocal = ytcontainer.NewYtsaurusLocal()
var err error

if err := suite.ytsaurusLocal.Start(); err != nil {
if suite.ytsaurusLocal, err = ytcontainer.RunContainer(suite.ctx); err != nil {
log.Fatalf("error starting ytsaurus local container: %s", err)
}

err := os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken)
err = os.Setenv(defaultYtsaurusSecretEnvVar, ytDevToken)
if err != nil {
log.Fatalf("failed to set YT_TOKEN: %s", err)
}

ytsaurusClient, err := suite.ytsaurusLocal.GetClient()
ytsaurusClient, err := suite.ytsaurusLocal.NewClient(suite.ctx)
if err != nil {
log.Fatalf("error creating ytsaurus local client: %s", err)
}
Expand All @@ -115,7 +115,7 @@ func (suite *AppTestSuite) SetupSuite() {
}

func (suite *AppTestSuite) TearDownSuite() {
if err := suite.ytsaurusLocal.Stop(); err != nil {
if err := suite.ytsaurusLocal.Terminate(suite.ctx); err != nil {
log.Fatalf("error terminating ytsaurus local container: %s", err)
}
}
Expand Down Expand Up @@ -237,12 +237,14 @@ func (suite *AppTestSuite) syncOnce(t *testing.T, source Source, clock clock.Pas
appConfig = defaultAppConfig
}

proxy, err := suite.ytsaurusLocal.GetProxy(suite.ctx)
require.NoError(t, err)
app, err := NewAppCustomized(
&Config{
App: *appConfig,
Azure: &AzureConfig{},
Ytsaurus: YtsaurusConfig{
Proxy: suite.ytsaurusLocal.GetProxy(),
Proxy: proxy,
ApplyUserChanges: true,
ApplyGroupChanges: true,
ApplyMemberChanges: true,
Expand Down Expand Up @@ -290,9 +292,11 @@ func (suite *AppTestSuite) TestManageUnmanagedUsersIsForbidden() {

defer suite.clear()

proxy, err := suite.ytsaurusLocal.GetProxy(suite.ctx)
require.NoError(t, err)
ytsaurus, err := NewYtsaurus(
&YtsaurusConfig{
Proxy: suite.ytsaurusLocal.GetProxy(),
Proxy: proxy,
LogLevel: "DEBUG",
},
getDevelopmentLogger(),
Expand Down
2 changes: 1 addition & 1 deletion app_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"testing"

"github.com/nebius/testcontainers-ytsaurus"
"github.com/stretchr/testify/require"
"github.com/tractoai/testcontainers-ytsaurus"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion deploy/chart/ytsaurus-identity-sync/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 1

image:
repository: ghcr.io/nebius/ytsaurus-active-directory-integration
repository: ghcr.io/tractoai/ytsaurus-identity-sync
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "2024-04-19-569ba16"
Expand Down
79 changes: 39 additions & 40 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nebius/ytsaurus-active-directory-integration
module github.com/tractoai/ytsaurus-identity-sync

go 1.22

Expand All @@ -11,14 +11,14 @@ require (
github.com/microsoft/kiota-abstractions-go v1.3.0
github.com/microsoftgraph/msgraph-sdk-go v1.24.0
github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0
github.com/nebius/testcontainers-ytsaurus v0.1.1
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.29.1
github.com/testcontainers/testcontainers-go/modules/openldap v0.29.1
go.uber.org/zap v1.26.0
github.com/testcontainers/testcontainers-go v0.31.0
github.com/testcontainers/testcontainers-go/modules/openldap v0.31.0
github.com/tractoai/testcontainers-ytsaurus v0.1.5
go.uber.org/zap v1.27.0
go.ytsaurus.tech/library/go/ptr v0.0.1
go.ytsaurus.tech/yt/go v0.0.13
go.ytsaurus.tech/yt/go v0.0.17
gopkg.in/yaml.v3 v3.0.1
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
)
Expand All @@ -27,37 +27,37 @@ require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.3 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cjlapao/common-go v0.0.39 // indirect
github.com/containerd/containerd v1.7.12 // indirect
github.com/containerd/containerd v1.7.16 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker v25.0.3+incompatible // indirect
github.com/docker/docker v26.1.2+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/tink/go v1.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/lufia/plan9stats v0.0.0-20240408141607-282e7b5d6b74 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/microsoft/kiota-authentication-azure-go v1.0.0 // indirect
github.com/microsoft/kiota-http-go v1.1.0 // indirect
Expand All @@ -67,6 +67,7 @@ require (
github.com/microsoft/kiota-serialization-text-go v1.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
Expand All @@ -78,34 +79,32 @@ require (
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/shirou/gopsutil/v3 v3.24.4 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/std-uritemplate/std-uritemplate/go v0.0.42 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.ytsaurus.tech/library/go/blockcodecs v0.0.2 // indirect
go.ytsaurus.tech/library/go/core/log v0.0.3 // indirect
go.ytsaurus.tech/library/go/core/xerrors v0.0.3 // indirect
go.ytsaurus.tech/library/go/x/xreflect v0.0.2 // indirect
go.ytsaurus.tech/library/go/x/xruntime v0.0.3 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434 // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.34.1 // indirect
)
Loading
Loading