Skip to content

Commit ab98d2f

Browse files
committed
chore: split test packages
1 parent 38a29de commit ab98d2f

File tree

197 files changed

+2838
-1764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+2838
-1764
lines changed

.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ linters:
199199
- linters:
200200
- gocyclo
201201
path: e2e
202-
- linters:
203-
- mnd
204-
path: internal/test/fixture
205202
paths:
206203
- third_party$
207204
- builtin$

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ ATLAS_INSTALL_PATH="${GOPATH}/bin/$(ATLAS_BINARY_NAME)"
1919

2020
LOCALDEV_IMAGE?=docker.io/mongodb/mongodb-atlas-local
2121
LINKER_FLAGS=-s -w -X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version.GitCommit=${GIT_SHA} -X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version.Version=${ATLAS_VERSION} -X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli/deployments/options.LocalDevImage=${LOCALDEV_IMAGE}
22-
ATLAS_E2E_BINARY?=../../bin/${ATLAS_BINARY_NAME}
22+
ATLAS_E2E_BINARY?=$(abspath bin/${ATLAS_BINARY_NAME})
23+
export SNAPSHOTS_DIR?=$(abspath test/e2e/testdata/.snapshots)
2324

2425
DEBUG_FLAGS=all=-N -l
2526

@@ -163,6 +164,12 @@ e2e-test: build-debug ## Run E2E tests
163164
@echo "==> Running E2E tests..."
164165
$(TEST_CMD) -v -p 1 -parallel $(E2E_PARALLEL) -v -timeout $(E2E_TIMEOUT) -tags="$(E2E_TAGS)" ./test/e2e... $(E2E_EXTRA_ARGS)
165166

167+
.PHONY: e2e-test-snapshots
168+
e2e-test-snapshots: export UPDATE_SNAPSHOTS=false
169+
e2e-test-snapshots: export E2E_SKIP_CLEANUP=true
170+
e2e-test-snapshots: build-debug ## Run E2E tests
171+
$(TEST_CMD) -v -p 1 -parallel $(E2E_PARALLEL) -v -timeout $(E2E_TIMEOUT) -tags="$(E2E_TAGS)" ./test/e2e... $(E2E_EXTRA_ARGS)
172+
166173
.PHONY: unit-test
167174
unit-test: build-debug ## Run unit-tests
168175
@echo "==> Running unit tests..."

test/e2e/access_lists_test.go renamed to test/e2e/accesslists/access_lists_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
//go:build e2e || (atlas && generic)
1515

16-
package e2e
16+
package accesslists
1717

1818
import (
1919
"encoding/json"

test/e2e/accesslists/constants.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2025 MongoDB Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package accesslists
16+
17+
const (
18+
accessListEntity = "accessList"
19+
)

test/e2e/access_logs_test.go renamed to test/e2e/accesslogs/access_logs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
//go:build e2e || (atlas && logs)
1515

16-
package e2e
16+
package accesslogs
1717

1818
import (
1919
"encoding/json"

test/e2e/accesslogs/constants.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2025 MongoDB Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package accesslogs
16+
17+
const (
18+
accessLogsEntity = "accessLogs"
19+
)

test/e2e/access_roles_test.go renamed to test/e2e/accessroles/access_roles_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
//go:build e2e || (atlas && generic)
1515

16-
package e2e
16+
package accessroles
1717

1818
import (
1919
"encoding/json"

test/e2e/accessroles/constants.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2025 MongoDB Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package accessroles
16+
17+
const (
18+
awsEntity = "aws"
19+
cloudProvidersEntity = "cloudProviders"
20+
accessRolesEntity = "accessRoles"
21+
)

test/e2e/alerts_test.go renamed to test/e2e/alerts/alerts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
//go:build e2e || (atlas && generic)
1515

16-
package e2e
16+
package alerts
1717

1818
import (
1919
"encoding/json"

test/e2e/alerts/constants.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2025 MongoDB Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package alerts
16+
17+
const (
18+
alertsEntity = "alerts"
19+
)

0 commit comments

Comments
 (0)