Skip to content
Merged
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
45 changes: 20 additions & 25 deletions depot/transformer/transformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ var _ = Describe("Transformer", func() {

process.Signal(os.Interrupt)
clock.Increment(1 * time.Second)
Eventually(process.Wait()).Should(Receive(nil))
var nilObject interface{}
Eventually(process.Wait()).Should(Receive(&nilObject))
})
})

Expand Down Expand Up @@ -346,7 +347,7 @@ var _ = Describe("Transformer", func() {
},
CheckDefinition: &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
HttpCheck: &models.HTTPCheck{
Port: 5432,
RequestTimeoutMs: 100,
Expand All @@ -356,11 +357,11 @@ var _ = Describe("Transformer", func() {
},
},
Ports: []executor.PortMapping{
executor.PortMapping{
{
HostPort: 61001,
ContainerPort: 8080,
},
executor.PortMapping{
{
HostPort: 61002,
ContainerPort: 61001,
},
Expand Down Expand Up @@ -726,7 +727,7 @@ var _ = Describe("Transformer", func() {
})
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
HttpCheck: &models.HTTPCheck{
Port: 5432,
RequestTimeoutMs: 100,
Expand Down Expand Up @@ -947,7 +948,7 @@ var _ = Describe("Transformer", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
ReadinessChecks: []*models.Check{
&models.Check{
{
TcpCheck: &models.TCPCheck{
Port: 5432,
ConnectTimeoutMs: 101,
Expand Down Expand Up @@ -1071,7 +1072,7 @@ var _ = Describe("Transformer", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
ReadinessChecks: []*models.Check{
&models.Check{
{
TcpCheck: &models.TCPCheck{
Port: 5432,
},
Expand Down Expand Up @@ -1376,7 +1377,7 @@ var _ = Describe("Transformer", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
HttpCheck: &models.HTTPCheck{
Port: 6432,
},
Expand Down Expand Up @@ -1507,7 +1508,7 @@ var _ = Describe("Transformer", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
HttpCheck: &models.HTTPCheck{
Port: 6432,
},
Expand Down Expand Up @@ -1537,7 +1538,6 @@ var _ = Describe("Transformer", func() {
"-liveness-interval=1s",
}))
})

})

Context("when the liveness check exits", func() {
Expand Down Expand Up @@ -1583,7 +1583,7 @@ var _ = Describe("Transformer", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
TcpCheck: &models.TCPCheck{
Port: 5432,
ConnectTimeoutMs: 100,
Expand All @@ -1598,7 +1598,7 @@ var _ = Describe("Transformer", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
TcpCheck: &models.TCPCheck{
Port: 6432,
},
Expand Down Expand Up @@ -1673,14 +1673,13 @@ var _ = Describe("Transformer", func() {
"-timeout=100ms",
"-liveness-interval=44ms",
}))

})

Context("and optional fields are missing", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
TcpCheck: &models.TCPCheck{
Port: 6432,
},
Expand Down Expand Up @@ -1710,15 +1709,14 @@ var _ = Describe("Transformer", func() {
}))
})
})

})
})

Context("logs", func() {
BeforeEach(func() {
container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
HttpCheck: &models.HTTPCheck{
Port: 5432,
RequestTimeoutMs: 2000,
Expand Down Expand Up @@ -1815,14 +1813,14 @@ var _ = Describe("Transformer", func() {

container.CheckDefinition = &models.CheckDefinition{
Checks: []*models.Check{
&models.Check{
{
TcpCheck: &models.TCPCheck{
Port: 2222,
ConnectTimeoutMs: 100,
IntervalMs: 50,
},
},
&models.Check{
{
HttpCheck: &models.HTTPCheck{
Port: 8080,
RequestTimeoutMs: 100,
Expand Down Expand Up @@ -2038,7 +2036,8 @@ var _ = Describe("Transformer", func() {

process.Signal(os.Interrupt)
clock.Increment(1 * time.Second)
Eventually(process.Wait()).Should(Receive(nil))
var nilObject interface{}
Eventually(process.Wait()).Should(Receive(&nilObject))
})

It("logs the container creation time", func() {
Expand Down Expand Up @@ -2083,9 +2082,7 @@ var _ = Describe("Transformer", func() {
})

Context("MonitorAction", func() {
var (
process ifrit.Process
)
var process ifrit.Process

JustBeforeEach(func() {
runner, _, err := optimusPrime.StepsRunner(logger, container, gardenContainer, logStreamer, cfg)
Expand Down Expand Up @@ -2114,9 +2111,7 @@ var _ = Describe("Transformer", func() {
})

Context("SuppressLogOutput", func() {
var (
monitorCh, actionCh chan int
)
var monitorCh, actionCh chan int

BeforeEach(func() {
monitorCh = make(chan int, 2)
Expand Down