Skip to content

Commit

Permalink
circleci config update
Browse files Browse the repository at this point in the history
  • Loading branch information
smgladkovskiy committed Apr 28, 2020
1 parent c5e64e8 commit 491724d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 50 deletions.
14 changes: 1 addition & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ jobs:
docker:
- image: circleci/golang:1.14
parallelism: 4
environment: # environment variables for the build itself
- IN_CONTAINER: true

# directory where steps are run. Path must conform to the Go Workspace requirements
working_directory: /configuration-go

steps:
- checkout
- run: go mod vendor
Expand All @@ -24,13 +18,7 @@ jobs:
- run:
name: tests
command: |
sudo mkdir -p /cfgs/defaults
sudo mkdir -p /cfgs/development
sudo chown -R circleci:circleci /cfgs
ln -s ${CIRCLE_WORKING_DIRECTORY}/test/configuration/defaults/* /cfgs/defaults/
ln -s ${CIRCLE_WORKING_DIRECTORY}/test/configuration/development/* /cfgs/development/
go test -coverprofile=c.out
go tool cover -html=c.out -o coverage.html
make test
mv coverage.html /tmp/artifacts
mv c.out /tmp/artifacts
- store_artifacts:
Expand Down
37 changes: 0 additions & 37 deletions reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,43 +141,6 @@ func TestReadConfigs(t *testing.T) {
assert.EqualValues(t, refConfig, config)
})

if GetEnv("IN_CONTAINER", "") == "true" {
t.Run("Success parsing symlinked files and dirs in root", func(t *testing.T) {
configBytes, err := ReadConfigs("/cfgs")
if !assert.NoError(t, err) {
t.FailNow()
}

type cfg struct {
Debug bool `yaml:"debug"`
Log struct {
Level string `yaml:"level"`
Format string `yaml:"format"`
} `yaml:"log"`
Host string `yaml:"host"`
Port string `yaml:"port"`
}

config := &cfg{}
err = yaml.Unmarshal(configBytes, &config)
if !assert.NoError(t, err) {
t.FailNow()
}

refConfig := &cfg{
Debug: true,
Log: struct {
Level string `yaml:"level"`
Format string `yaml:"format"`
}{Level: "warn", Format: "json"},
Host: "localhost",
Port: "8080",
}

assert.EqualValues(t, refConfig, config)
})
}

t.Run("Fail dir not found", func(t *testing.T) {
_, err := ReadConfigs("")
if !assert.Error(t, err) {
Expand Down

0 comments on commit 491724d

Please sign in to comment.