MCPcopy
hub / github.com/harness/harness / createNestedSpacesForStorageSize

Function createNestedSpacesForStorageSize

app/store/database/space_test.go:74–103  ·  view source on GitHub ↗
(
	ctx context.Context,
	t *testing.T,
	spaceStore store.SpaceStore,
)

Source from the content-addressed store, hash-verified

72}
73
74func createNestedSpacesForStorageSize(
75 ctx context.Context,
76 t *testing.T,
77 spaceStore store.SpaceStore,
78) []types.Space {
79 // Create root spaces
80 rootSpaces := []types.Space{
81 {Identifier: "root-space-1", Description: "Root Space 1"},
82 {Identifier: "root-space-2", Description: "Root Space 2"},
83 {Identifier: "root-space-3", Description: "Root Space 3"},
84 }
85
86 for _, rootSpace := range rootSpaces {
87 err := spaceStore.Create(ctx, &rootSpace)
88 require.NoError(t, err)
89
90 // Create nested subspaces for each root space
91 for j := 1; j <= 3; j++ { // Create 3 subspaces for each root space
92 subSpace := types.Space{
93 Identifier: fmt.Sprintf("sub-space-%d-of-%s", j, rootSpace.Identifier),
94 ParentID: rootSpace.ID, // Set the parent ID to the root space ID
95 Description: fmt.Sprintf("Sub Space %d of %s", j, rootSpace.Identifier),
96 }
97 err = spaceStore.Create(ctx, &subSpace)
98 require.NoError(t, err)
99 }
100 }
101
102 return rootSpaces
103}
104
105func createRepositoriesForSpaces(
106 ctx context.Context,

Callers 1

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…