trivago / gollum

An n:m message multiplexer written in Go
http://gollum.readthedocs.org/en/latest/
Apache License 2.0
940 stars 74 forks source link

0.5.0 ERROR Failed to read config error=yaml: unmarshal errors: #216

Closed ilovezfs closed 6 years ago

ilovezfs commented 6 years ago

The Homebrew test block fails for 0.5.0, but passed for 0.4.5

https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/15124/

Issue description

The test block should pass.

Context

I'm trying to get 0.5.0 green in Homebrew's CI and merged. See https://github.com/Homebrew/homebrew-core/pull/22000.

Possible Solution

Probably we just need to update the test block with some tweak to the config file.

Steps to Reproduce (for bugs)

bash-3.2$ cat test.conf 
- "consumer.Profiler":
    Enable: true
    Runs: 100000
    Batches: 100
    Characters: "abcdefghijklmnopqrstuvwxyz .,!;:-_"
    Message: "%256s"
    Stream: "profile"
bash-3.2$ /usr/local/Cellar/gollum/0.5.0/bin/gollum -tc /tmp/gollum-test-20171221-61659-1kkdhlq/test.conf                                                                                                  
[2017-12-21 13:54:13 PST] ERROR Failed to read config error=yaml: unmarshal errors:
  line 1: cannot unmarshal !!seq into map[string]tcontainer.MarshalMap
bash-3.2$
  1. brew pull https://github.com/Homebrew/homebrew-core/pull/22000
  2. brew install -dvs gollum
  3. brew test -vd gollum

Your Environment

Used versions

Config:

- "consumer.Profiler":
    Enable: true
    Runs: 100000
    Batches: 100
    Characters: "abcdefghijklmnopqrstuvwxyz .,!;:-_"
    Message: "%256s"
    Stream: "profile"

The test block runs

  test do
    (testpath/"test.conf").write <<~EOS
      - "consumer.Profiler":
          Enable: true
          Runs: 100000
          Batches: 100
          Characters: "abcdefghijklmnopqrstuvwxyz .,!;:-_"
          Message: "%256s"
          Stream: "profile"
    EOS

    assert_match "parsed as ok", shell_output("#{bin}/gollum -tc #{testpath}/test.conf")
  end
arnecls commented 6 years ago

As stated in the release notes the configuration format changed for gollum 0.5.0 Your config should now look like this

Profiler:
    Type: consumer.Profiler
    Enable: true
    Runs: 100000
    Batches: 100
    Characters: "abcdefghijklmnopqrstuvwxyz .,!;:-_"
    Message: "%256s"
    Streams: "profile"

also see https://github.com/trivago/gollum/blob/master/config/profile.conf

arnecls commented 6 years ago

Also the result of gollum -tc should now be

Testing config testpath/test.conf
Config OK.
ilovezfs commented 6 years ago
bash-3.2$ cat test.conf 
Profiler:
    Type: consumer.Profiler
    Enable: true
    Runs: 100000
    Batches: 100
    Characters: "abcdefghijklmnopqrstuvwxyz .,!;:-_"
    Message: "%256s"
    Streams: "profile"
bash-3.2$ /usr/local/Cellar/gollum/0.5.0/bin/gollum -tc /tmp/gollum-test-20171221-61985-vge4co/test.conf
Testing config /tmp/gollum-test-20171221-61985-vge4co/test.conf
[2017-12-21 14:05:57 PST] ERROR Configure pass failed. error=No valid producers found
bash-3.2$ 
arnecls commented 6 years ago

Ah - my bad. Please use the file I linked above or take the producer part from it.

P.s.: Additional answers from my side might be delayed until tomorrow morning (CET)

ilovezfs commented 6 years ago

Works! Perfect. Thank you :)

arnecls commented 6 years ago

:+1: thank you for keeping track of the homebrew package!

ilovezfs commented 6 years ago

You're welcome! :)