Skip to content

Commit f0f7228

Browse files
committed
remvoed unused methods and tests
1 parent ec943fa commit f0f7228

File tree

5 files changed

+4
-112
lines changed

5 files changed

+4
-112
lines changed

artifactory/commands/conan/artifacts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (bps *BuildPropertySetter) SetProperties(artifacts []entities.Artifact) err
214214
timestamp := strconv.FormatInt(time.Now().UnixMilli(), 10)
215215
props := bps.formatBuildProperties(timestamp)
216216

217-
_, err = servicesManager.SetProps(services.PropsParams{Reader: reader, Props: props})
217+
_, err = servicesManager.SetProps(services.PropsParams{Reader: reader, Props: props, UseDebugLogs: true, IsRecursive: true})
218218
if err != nil {
219219
return fmt.Errorf("set properties: %w", err)
220220
}

artifactory/commands/conan/artifacts_test.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -149,56 +149,6 @@ func TestBuildArtifactQuery(t *testing.T) {
149149
}
150150
}
151151

152-
func TestClassifyArtifactType(t *testing.T) {
153-
tests := []struct {
154-
name string
155-
filename string
156-
expected string
157-
}{
158-
{
159-
name: "Conan recipe file",
160-
filename: "conanfile.py",
161-
expected: "conan-recipe",
162-
},
163-
{
164-
name: "Conan manifest file",
165-
filename: "conanmanifest.txt",
166-
expected: "conan-manifest",
167-
},
168-
{
169-
name: "Conan info file",
170-
filename: "conaninfo.txt",
171-
expected: "conan-info",
172-
},
173-
{
174-
name: "Conan sources archive",
175-
filename: "conan_sources.tgz",
176-
expected: "conan-package",
177-
},
178-
{
179-
name: "Conan package archive",
180-
filename: "conan_package.tgz",
181-
expected: "conan-package",
182-
},
183-
{
184-
name: "Unknown file type",
185-
filename: "readme.md",
186-
expected: "conan-artifact",
187-
},
188-
{
189-
name: "Header file",
190-
filename: "mylib.h",
191-
expected: "conan-artifact",
192-
},
193-
}
194-
195-
for _, tt := range tests {
196-
t.Run(tt.name, func(t *testing.T) {
197-
result := classifyArtifactType(tt.filename)
198-
assert.Equal(t, tt.expected, result)
199-
})
200-
}
201-
}
202152

203153
func TestBuildPropertySetter_FormatBuildProperties(t *testing.T) {
204154
tests := []struct {

artifactory/commands/conan/command_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,6 @@ func TestConanCommand_ChainedSetters(t *testing.T) {
121121
assert.Equal(t, serverDetails, cmd.serverDetails)
122122
}
123123

124-
func TestNewDependencyCollector(t *testing.T) {
125-
workingDir := "/test/path"
126-
127-
collector := NewDependencyCollector(workingDir, nil)
128-
129-
assert.NotNil(t, collector)
130-
assert.Equal(t, workingDir, collector.workingDir)
131-
assert.Nil(t, collector.buildConfiguration)
132-
}
133124

134125

135126

artifactory/commands/conan/login_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func TestExtractCredentials(t *testing.T) {
213213
serverDetails: &config.ServerDetails{
214214
AccessToken: "my-access-token",
215215
},
216-
expectedUsername: "token",
216+
expectedUsername: "admin", // Defaults to "admin" when no user specified
217217
expectedPassword: "my-access-token",
218218
expectError: false,
219219
},
@@ -228,14 +228,14 @@ func TestExtractCredentials(t *testing.T) {
228228
expectError: false,
229229
},
230230
{
231-
name: "Prefer access token over password",
231+
name: "Prefer password over access token",
232232
serverDetails: &config.ServerDetails{
233233
User: "myuser",
234234
Password: "mypassword",
235235
AccessToken: "my-access-token",
236236
},
237237
expectedUsername: "myuser",
238-
expectedPassword: "my-access-token",
238+
expectedPassword: "mypassword", // Password is preferred for Conan (API keys work more reliably)
239239
expectError: false,
240240
},
241241
{

artifactory/commands/conan/upload_test.go

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -114,46 +114,6 @@ Upload completed in 3s
114114
}
115115
}
116116

117-
func TestUploadProcessor_ParseUploadPattern(t *testing.T) {
118-
tests := []struct {
119-
name string
120-
lines []string
121-
expected string
122-
}{
123-
{
124-
name: "Standard uploading recipe line",
125-
lines: []string{
126-
"simplelib/1.0.0: Uploading recipe 'simplelib/1.0.0#86deb56ab95f8fe27d07debf8a6ee3f9' (1.6KB)",
127-
},
128-
expected: "simplelib/1.0.0",
129-
},
130-
{
131-
name: "Multiple lines with uploading recipe",
132-
lines: []string{
133-
"Some other line",
134-
"mypackage/2.0.0: Uploading recipe 'mypackage/2.0.0#abc123' (2KB)",
135-
"Another line",
136-
},
137-
expected: "mypackage/2.0.0",
138-
},
139-
{
140-
name: "No uploading recipe line",
141-
lines: []string{
142-
"Some output",
143-
"No recipe here",
144-
},
145-
expected: "",
146-
},
147-
}
148-
149-
for _, tt := range tests {
150-
t.Run(tt.name, func(t *testing.T) {
151-
processor := &UploadProcessor{}
152-
result := processor.parseUploadPattern(tt.lines)
153-
assert.Equal(t, tt.expected, result)
154-
})
155-
}
156-
}
157117

158118
func TestNewUploadProcessor(t *testing.T) {
159119
workingDir := "/test/path"
@@ -166,15 +126,6 @@ func TestNewUploadProcessor(t *testing.T) {
166126
assert.Nil(t, processor.serverDetails)
167127
}
168128

169-
func TestNewFlexPackCollector(t *testing.T) {
170-
workingDir := "/test/path"
171-
172-
collector, err := NewFlexPackCollector(workingDir)
173-
174-
assert.NoError(t, err)
175-
assert.NotNil(t, collector)
176-
assert.Equal(t, workingDir, collector.config.WorkingDirectory)
177-
}
178129

179130

180131

0 commit comments

Comments
 (0)