Skip to content

Commit

Permalink
fix tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Dec 2, 2024
1 parent 0081bde commit 9190008
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 473 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COVERAGE_DIR?=$(shell mktemp -d)
GOOS=$(shell go env GOHOSTOS)
GOARCH=$(shell go env GOHOSTARCH)

# Uncomment to update test outputs
# Uncomment to update system test gold files
# CAPTURE := "--capture"

help: ## Print this help
Expand Down
4 changes: 2 additions & 2 deletions cmd/config_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
)

func aptlyConfigShow(_ *commander.Command, _ []string) error {
show_yaml := context.Flags().Lookup("yaml").Value.Get().(bool)
showYaml := context.Flags().Lookup("yaml").Value.Get().(bool)

config := context.Config()

if show_yaml {
if showYaml {
yamlData, err := yaml.Marshal(&config)
if err != nil {
return fmt.Errorf("error marshaling to YAML: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ func (s *AptlyContextSuite) TestGetPublishedStorageBadFS(c *C) {
// storage never exists.
c.Assert(func() { s.context.GetPublishedStorage("filesystem:fuji") },
FatalErrorPanicMatches,
&FatalError{ReturnCode: 1, Message: fmt.Sprintf("error loading config file %s/.aptly.conf: EOF",
&FatalError{ReturnCode: 1, Message: fmt.Sprintf("error loading config file %s/.aptly.conf: not valid yaml or json",
os.Getenv("HOME"))})
}
2 changes: 1 addition & 1 deletion system/t02_config/BadConfigTest_gold
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ERROR: error loading config file ${HOME}/.aptly.conf: invalid character 's' looking for beginning of object key string
ERROR: error loading config file ${HOME}/.aptly.conf: not valid yaml or json
42 changes: 21 additions & 21 deletions system/t02_config/ConfigShowTest_gold
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"rootDir": "${HOME}/.aptly",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"downloadRetries": 5,
"downloader": "default",
"logLevel": "debug",
"logFormat": "default",
"databaseOpenAttempts": 10,
"architectures": [],
"skipLegacyPool": false,
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"dependencyVerboseResolve": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"gpgProvider": "gpg",
"downloadSourcePackages": false,
"packagePoolStorage": {},
"skipLegacyPool": false,
"ppaDistributorID": "ubuntu",
"ppaCodename": "",
"serveInAPIMode": true,
"enableMetricsEndpoint": true,
"enableSwaggerEndpoint": false,
"AsyncAPI": false,
"databaseBackend": {
"type": "",
"dbPath": "",
"url": ""
},
"downloader": "default",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"downloadRetries": 5,
"downloadSourcePackages": false,
"gpgProvider": "gpg",
"gpgDisableSign": false,
"gpgDisableVerify": false,
"skipContentsPublishing": false,
"skipBz2Publishing": false,
"FileSystemPublishEndpoints": {},
"S3PublishEndpoints": {},
"SwiftPublishEndpoints": {},
"AzurePublishEndpoints": {},
"AsyncAPI": false,
"enableMetricsEndpoint": true,
"logLevel": "debug",
"logFormat": "default",
"serveInAPIMode": true,
"databaseBackend": {
"type": "",
"url": "",
"dbPath": ""
},
"enableSwaggerEndpoint": false
"packagePoolStorage": {}
}
Loading

0 comments on commit 9190008

Please sign in to comment.