Skip to content

Commit

Permalink
Merge pull request #266 from ruflin/tests-renaming
Browse files Browse the repository at this point in the history
Rename integration to system tests
  • Loading branch information
tsg committed Sep 24, 2015
2 parents 6c12875 + 156c3b8 commit e23799a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ full-coverage:
make -C ./tests coverage
# Writes count mode on top of file
echo 'mode: count' > ./coverage/full.cov
# Collects all integration coverage files and skips top line with mode
# Collects all coverage files and skips top line with mode
tail -q -n +2 ./coverage/*.cov >> ./coverage/full.cov
$(GODEP) go tool cover -html=./coverage/full.cov -o coverage/full.html
4 changes: 2 additions & 2 deletions docs/new_protocol.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ As an example, here is the relevant code from the REDIS module:
----------------------------------------------------------------------

The following fields are required and their presence will be checked by
integration tests:
system tests:

* `timestamp`. Set this to the timestamp of the first packet from the message
and cast it to `common.Time` like in the example above.
Expand Down Expand Up @@ -571,7 +571,7 @@ there's no transaction present.
To check the coverage of your unit tests, run the `make cover` command at the
top of the repository.

==== Integration testing
==== Sytem testing

Because the main input to Packetbeat are packets and the main output are JSON
objects, a convenient way of testing its functionality is by providing PCAP
Expand Down
10 changes: 5 additions & 5 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package main

// This file is mandatory as otherwise the packetbeat.test binary is not generated correctly. Reason???
// This file is mandatory as otherwise the packetbeat.test binary is not generated correctly.

import (
"testing"
"flag"
)

var integration *bool
var systemTest *bool

func init() {
integration = flag.Bool("integration", false, "Set to true when running integration tests")
systemTest = flag.Bool("systemTest", false, "Set to true when running system tests")
}

// Test started when the test binary is started. Only calls main.
func TestIntegration(t *testing.T) {
func TestSystem(t *testing.T) {

if *integration {
if *systemTest {
main()
}
}
8 changes: 4 additions & 4 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test:
coverage: test
mkdir -p ../coverage
# Writes count mode on top of file
echo 'mode: count' > ../coverage/integration.cov
# Collects all integration coverage files and skips top line with mode
tail -q -n +2 ./run/**/*.cov >> ../coverage/integration.cov
echo 'mode: count' > ../coverage/system.cov
# Collects all system coverage files and skips top line with mode
tail -q -n +2 ./run/**/*.cov >> ../coverage/system.cov
# Generates HTML output
go tool cover -html=../coverage/integration.cov -o ../coverage/integration.html
go tool cover -html=../coverage/system.cov -o ../coverage/system.html

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Automatic tests for Packetbeat

This repository contains the integration tests for the [Packetbeat](http://packetbeat.com)
This repository contains the system tests for the [Packetbeat](http://packetbeat.com)
project.

## Running
Expand Down
4 changes: 2 additions & 2 deletions tests/pbtests/packetbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def run_packetbeat(self, pcap,
"-I", os.path.join("pcaps", pcap),
"-c", os.path.join(self.working_dir, config),
"-t",
"-integration",
"-systemTest",
"-test.coverprofile", os.path.join(self.working_dir, "coverage.cov")
])
if extra_args:
Expand Down Expand Up @@ -95,7 +95,7 @@ def start_packetbeat(self,
args = [cmd,
"-e",
"-c", os.path.join(self.working_dir, config),
"-integration",
"-systemTest",
"-test.coverprofile", os.path.join(self.working_dir, "coverage.cov")
]
if extra_args:
Expand Down

0 comments on commit e23799a

Please sign in to comment.