Skip to content

Commit

Permalink
cardano-tracer: fixed and improved tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Shevchenko authored and deepfire committed Oct 6, 2021
1 parent 2ccf7ec commit 52bb671
Show file tree
Hide file tree
Showing 27 changed files with 1,231 additions and 957 deletions.
2 changes: 1 addition & 1 deletion cardano-tracer/app/cardano-tracer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ main = do
tracerInfo :: ParserInfo TracerParams
tracerInfo = info
(parseTracerParams <**> helper <**> versionOption)
(fullDesc <> header "cardano-tracer - the logging/monitoring service for cardano node.")
(fullDesc <> header "cardano-tracer - the logging/monitoring service for Cardano node.")
versionOption = infoOption
(showVersion version)
(long "version" <>
Expand Down
68 changes: 30 additions & 38 deletions cardano-tracer/cardano-tracer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,37 @@ build-type: Simple
extra-doc-files: README.md
CHANGELOG.md

common common-options
build-depends: base >=4.12 && <5
common base { build-depends: base >= 4.14 && < 4.15 }

common project-config
default-language: Haskell2010

ghc-options: -Wall
-Wcompat
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
if impl(ghc >= 8.0)
ghc-options: -Wredundant-constraints
if impl(ghc >= 8.2)
ghc-options: -fhide-source-paths
if impl(ghc >= 8.4)
ghc-options: -Wmissing-export-lists
-Wincomplete-uni-patterns
-Wno-unticked-promoted-constructors
-Wno-orphans
-Wpartial-fields

default-language: Haskell2010
-Wredundant-constraints
-Wunused-packages

library
import: common-options
import: base, project-config
hs-source-dirs: src

exposed-modules: Cardano.Tracer.Acceptors
Cardano.Tracer.CLI
Cardano.Tracer.Configuration
Cardano.Tracer.Handlers
Cardano.Tracer.Run
Cardano.Tracer.Types

Cardano.Tracer.Handlers

Cardano.Tracer.Handlers.Logs.File
Cardano.Tracer.Handlers.Logs.Journal
Cardano.Tracer.Handlers.Logs.Log
Cardano.Tracer.Handlers.Logs.Rotator
Cardano.Tracer.Handlers.Logs.Run

Cardano.Tracer.Handlers.Metrics.Monitoring
Cardano.Tracer.Handlers.Metrics.Prometheus
Expand All @@ -69,10 +66,8 @@ library
, filepath
, hashable
, libsystemd-journal
, network
, optparse-applicative
, ouroboros-network-framework
, serialise
, snap-blaze
, snap-core
, snap-server
Expand All @@ -84,35 +79,38 @@ library
, unordered-containers

executable cardano-tracer
import: base, project-config

hs-source-dirs: app

main-is: cardano-tracer.hs

other-modules: Paths_cardano_tracer

build-depends: base
, cardano-tracer
build-depends: cardano-tracer
, optparse-applicative
, text

default-language: Haskell2010
ghc-options: -Wall
-threaded
ghc-options: -threaded
-rtsopts
-with-rtsopts=-T

test-suite cardano-tracer-test
import: common-options
import: base, project-config
type: exitcode-stdio-1.0

hs-source-dirs: test

main-is: cardano-tracer-test.hs
other-modules: Cardano.Tracer.Test.Types
Cardano.Tracer.Test.Forwarder
Cardano.Tracer.Test.Logs.File
Cardano.Tracer.Test.Logs.Rotator

build-depends: aeson
, async
other-modules: Cardano.Tracer.Test.Forwarder
Cardano.Tracer.Test.Logs.Tests
Cardano.Tracer.Test.Network.Tests
Cardano.Tracer.Test.Queue.Tests
Cardano.Tracer.Test.SSH.Tests

Cardano.Tracer.Test.Utils

build-depends: async
, base
, bytestring
, cardano-tracer
Expand All @@ -121,25 +119,19 @@ test-suite cardano-tracer-test
, directory
, ekg-core
, ekg-forward
, extra
, filepath
, io-sim
, io-classes
, network
, ouroboros-network-framework
, process
, QuickCheck
, serialise
, stm
, tasty
, tasty-quickcheck
, text
, time
, trace-dispatcher
, trace-forward
, typed-protocols-examples
, unordered-containers
, vector

ghc-options: -threaded
-rtsopts
-with-rtsopts=-N
default-extensions: OverloadedStrings
13 changes: 5 additions & 8 deletions cardano-tracer/configuration/example.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"connectMode": "Initiator",
"acceptAt": [
"/tmp/forwarder-1.sock",
"/tmp/forwarder-2.sock",
"/tmp/forwarder-3.sock"
],
"loRequestNum": 1,
"ekgRequestFreq": 1,
"network": {
"tag": "AcceptAt",
"contents": "/tmp/forwarder-1.sock"
},
"hasEKG": null,
"hasPrometheus": [
"127.0.0.1",
Expand All @@ -25,3 +21,4 @@
"rpMaxAgeHours": 1
}
}

Loading

0 comments on commit 52bb671

Please sign in to comment.