Skip to content
This repository was archived by the owner on Apr 8, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################

#####
# OS X temporary files that should never be committed

.DS_Store
*.swp
*.lock

pebble/build
aa/build

.vagrant

####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib


####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"

DerivedData/

# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

## / /build/


#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"

*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3


####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
# throw away ALL personal settings (including custom schemes!
# - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata

# OPTION 2: ---------------------------------
# get rid of ALL personal settings, but KEEP SOME OF THEM
# - NB: you must manually uncomment the bits you want to keep
#
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*

# (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*

####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
# /(project-name).xcodeproj/
# project.pbxproj
# /project.xcworkspace/
# contents.xcworkspacedata
# /xcuserdata/
# /(your name)/xcuserdatad/
# UserInterfaceState.xcuserstate
# /xcsshareddata/
# /xcschemes/
# (shared scheme name).xcscheme
# /xcuserdata/
# /(your name)/xcuserdatad/
# (private scheme).xcscheme
# xcschememanagement.plist
#
#

####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!

*.moved-aside


####
# UNKNOWN: recommended by others, but I can't discover what these files are
#
# ...none. Everything is now explained.
.lock-waf_darwin_build

.idea

Pods
*.xcworkspace

target

journal
snapshots

native.iml

checkpoint

1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8
4 changes: 4 additions & 0 deletions .jvmopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-XX:MaxMetaspaceSize=256m
-Xss2m
-Xms1g
-Xmx1g
33 changes: 33 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pipeline {
agent {
label 'sbt-slave'
}

stages {
stage('Cross Scala Build Pipeline') {
steps {
ansiColor('xterm') {
script {
// The following values need to be synced with those in build.sbt and CommonProject.scala
def crossScalaVersions = ["2.11.12", "2.12.4"]
crossScalaVersions.each { SCALA_VERSION ->
def scalaVersion = SCALA_VERSION.substring(0, 4)
sh "sbt ++$SCALA_VERSION clean compile test:compile doc"
sh "sbt ++$SCALA_VERSION coverage test"
sh "sbt ++$SCALA_VERSION coverageReport"
sh "sbt ++$SCALA_VERSION coverageAggregate"
publishHTML([
allowMissing : false,
alwaysLinkToLastBuild: false,
keepAll : true,
reportDir : "target/scala-$scalaVersion/scoverage-report",
reportFiles : "index.html",
reportName : "Scala $scalaVersion Unit Test Coverage Report"
])
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Logging Testkit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan is to update this file once all of ISC-377 has been completed.


TODO:

# Publishing and Releasing

Once we have merged a set of feature branches into the `master` branch and are ready to cut a release:
```
git tag -s vX.Y.Z
git push -tags
sbt ghpagesPushSite
sbt "+ publishSigned"
sbt sonatypeRelease
```

Code should now be available from Maven Central at version X.Y.Z.
53 changes: 53 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2018 Cake Solutions Limited

import Dependencies._

enablePlugins(GitBranchPrompt)
enablePlugins(GitVersioning)
enablePlugins(SiteScaladocPlugin)

// The following values need to be synced with those in Jenkinsfile
crossScalaVersions := Seq("2.11.12", "2.12.4")
scalaVersion := crossScalaVersions.value.head

Publish.settings

git.useGitDescribe := true
ivyLoggingLevel := UpdateLogging.Quiet

lazy val core = project.in(file("core"))
.settings(CommonProject.settings)
.settings(ScalaDoc.settings)
.settings(
name := "logging-testkit",
publishArtifact in (Test, packageBin) := true,
libraryDependencies ++= Seq(
circe.core,
circe.generic,
circe.parser,
logback,
logging,
monix.core,
monix.reactive,
scalatest % Test,
scalacheck % Test
),
coverageMinimum := 75
)

lazy val docker = project.in(file("instrumentation/docker"))
.dependsOn(core % "compile->compile; test->test")
.settings(CommonProject.settings)
.settings(
name := "logging-testkit-docker",
coverageMinimum := 70
)

lazy val elasticsearch = project.in(file("instrumentation/elasticsearch"))
.dependsOn(core % "compile->compile; test->test")
.settings(CommonProject.settings)
.settings(
name := "logging-testkit-elasticsearch",
libraryDependencies += aws.logs,
coverageMinimum := 100
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2018 Cake Solutions Limited

package net.cakesolutions.testkit.config

import scala.concurrent.duration._

import net.cakesolutions.testkit.config.Environment.Optional

/**
* Library configuration.
*/
object Configuration {
object Logging {
/**
* Logger name.
*/
val name: String = "LoggingTestkit"
}

object Timeout {
/**
* @see net.cakesolutions.testkit.config.Environment.Optional.TIMEOUT_DELAY
*/
val delay: FiniteDuration = Optional.TIMEOUT_DELAY.withDefault(0.seconds)

/**
* @see net.cakesolutions.testkit.config.Environment.Optional.TIMEOUT_PERIOD
*/
val period: FiniteDuration = Optional.TIMEOUT_PERIOD.withDefault(100.milliseconds)
}

private implicit class ConfigurationHelper(value: Option[String]) {
def withDefault(default: FiniteDuration): FiniteDuration = {
value.map(Duration(_)).collect { case d: FiniteDuration => d }.getOrElse(default)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2018 Cake Solutions Limited

package net.cakesolutions.testkit.config

/**
* DevOps environment variable interface
*
* Without exception, **all** entries in here should be fully documented!
*/
object Environment {
/**
* Required configuration settings are placed here
*/
object Required {

}

/**
* Optional configuration settings are placed here (these may have sensible
* default values defined **elsewhere**)
*/
object Optional {
/**
* Duration that we wait for before allowing monitor timeout's to execute.
*/
val TIMEOUT_DELAY: Option[String] = sys.env.get("TIMEOUT_DELAY")
/**
* Periodicity with which monitor timeouts are checked for expiration.
*/
val TIMEOUT_PERIOD: Option[String] = sys.env.get("TIMEOUT_PERIOD")
}
}
Loading