From 5e49d287af2cdb539dfe8e9c96e44233c3512c0a Mon Sep 17 00:00:00 2001 From: Ruflin Date: Wed, 23 Sep 2015 13:01:49 +0200 Subject: [PATCH] Rename integration to system tests --- Makefile | 2 +- docs/new_protocol.asciidoc | 4 ++-- main_test.go | 10 +++++----- tests/Makefile | 8 ++++---- tests/README.md | 2 +- tests/pbtests/packetbeat.py | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 213056bf1ad3..c52b776926f9 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/new_protocol.asciidoc b/docs/new_protocol.asciidoc index a3af730540cf..33c8bae975a7 100644 --- a/docs/new_protocol.asciidoc +++ b/docs/new_protocol.asciidoc @@ -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. @@ -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 diff --git a/main_test.go b/main_test.go index e1beacfe6f64..fa80deb24441 100644 --- a/main_test.go +++ b/main_test.go @@ -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() } } diff --git a/tests/Makefile b/tests/Makefile index 2bd652567d4c..a14969b82712 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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: diff --git a/tests/README.md b/tests/README.md index ae06451df0da..50c60e69912a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -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 diff --git a/tests/pbtests/packetbeat.py b/tests/pbtests/packetbeat.py index 8ed13d1add36..8f61e11d3bd3 100644 --- a/tests/pbtests/packetbeat.py +++ b/tests/pbtests/packetbeat.py @@ -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: @@ -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: