1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00
pgbackrest/test/define.yaml
David Steele 065b5f93ae Improve test coverage list handling.
All unit tests now require full coverage so the "full" keyword is obsolete and has been removed.

The covered code modules are simply listed, with only "no code" modules annotated.
2021-01-15 10:56:51 -05:00

791 lines
26 KiB
YAML

# **********************************************************************************************************************************
# Test Definition
#
# Contains definitions for all unit and integration tests.
#
# The definitions consist of modules and tests. Modules group together tests that are related and allow common settings for all the
# tests. Every module and test must have a name. Tests must also have a total. If this total does not match the actual number of
# runs in a test then an error will be thrown.
#
# Most options can be set for modules and tests (test option will override module option if both are set):
# * db - determines if the test will be run against multiple db versions
# * define - defines for C code (will also be applied to the test harness)
# * define-test - defines for the test harness
# * debugUnitSuppress - don't define DEBUG_UNIT for unit tests -- this is used to test unit test debugging macros
# * binReq - is the pgbackrest binary required for this test?
# * containerReq - is this test required to run in a container?
#
# Some options are unique to tests:
# * coverage - a list of code modules that the test provides coverage for. A code module may be covered by multiple tests. That
# means you must run all the tests by providing the --run option multiple times to get full coverage on the code module. If
# a code module contains only data it should be marked noCode (e.g. - help/help.auto.c: noCode).
# * total - total runs in the test
# * vm - VMs that the test will be run on
# * include - modules to include directly into test.c (all files in coverage are automatically included)
# This is useful when a module's internal data needs to be manipulated for testing but no coverage is added by the test.
# **********************************************************************************************************************************
# **********************************************************************************************************************************
# Unit tests
# **********************************************************************************************************************************
unit:
# ********************************************************************************************************************************
- name: common
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: error
total: 8
define-test: -DNO_ERROR -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
coverage:
- common/error
- common/error.auto: noCode
# ----------------------------------------------------------------------------------------------------------------------------
- name: assert-on
total: 1
define-test: -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
coverage:
- common/assert: noCode
# ----------------------------------------------------------------------------------------------------------------------------
- name: assert-off
total: 1
define: -DNDEBUG
define-test: -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
debugUnitSuppress: true
coverage:
- common/assert: noCode
# ----------------------------------------------------------------------------------------------------------------------------
- name: stack-trace
total: 4
define-test: -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
coverage:
- common/stackTrace
# ----------------------------------------------------------------------------------------------------------------------------
- name: mem-context
total: 7
define-test: -DNO_MEM_CONTEXT -DNO_LOG -DNO_STAT
coverage:
- common/memContext
# ----------------------------------------------------------------------------------------------------------------------------
- name: time
total: 3
define-test: -DNO_ERROR -DNO_LOG
coverage:
- common/time
# ----------------------------------------------------------------------------------------------------------------------------
- name: fork
total: 1
define-test: -DNO_LOG
coverage:
- common/fork
# ----------------------------------------------------------------------------------------------------------------------------
- name: log
total: 5
define-test: -DNO_LOG
coverage:
- common/log
# ----------------------------------------------------------------------------------------------------------------------------
- name: debug-off
total: 2
define: -DNDEBUG
define-test: -DNO_LOG
debugUnitSuppress: true
coverage:
- common/debug
# ----------------------------------------------------------------------------------------------------------------------------
- name: debug-on
total: 4
coverage:
- common/debug
# ----------------------------------------------------------------------------------------------------------------------------
- name: lock
total: 2
coverage:
- common/lock
# ----------------------------------------------------------------------------------------------------------------------------
- name: exit
total: 3
coverage:
- common/exit
# ----------------------------------------------------------------------------------------------------------------------------
- name: wait
total: 1
coverage:
- common/wait
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-convert
total: 11
coverage:
- common/type/convert
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-object
total: 1
coverage:
- common/type/object: noCode
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-list
total: 4
coverage:
- common/type/list
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-string
total: 26
coverage:
- common/type/string
- common/type/stringList
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-buffer
total: 6
coverage:
- common/type/buffer
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-variant
total: 12
coverage:
- common/type/variant
- common/type/variantList
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-pack
total: 1
coverage:
- common/type/pack
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-mcv
total: 1
coverage:
- common/type/mcv
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-json
total: 11
coverage:
- common/type/json
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-key-value
total: 2
coverage:
- common/type/keyValue
# ----------------------------------------------------------------------------------------------------------------------------
- name: type-xml
total: 1
coverage:
- common/type/xml
# ----------------------------------------------------------------------------------------------------------------------------
- name: stat
total: 1
coverage:
- common/stat
# ----------------------------------------------------------------------------------------------------------------------------
- name: user
total: 1
coverage:
- common/user
# ----------------------------------------------------------------------------------------------------------------------------
- name: io
total: 4
coverage:
- common/io/bufferRead
- common/io/bufferWrite
- common/io/fd
- common/io/fdRead
- common/io/fdWrite
- common/io/filter/buffer
- common/io/filter/filter
- common/io/filter/group
- common/io/filter/sink
- common/io/filter/size
- common/io/io
- common/io/read
- common/io/write
# ----------------------------------------------------------------------------------------------------------------------------
- name: io-tls
total: 5
coverage:
- common/io/client
- common/io/session
- common/io/tls/client
- common/io/tls/session
- common/io/socket/client
- common/io/socket/common
- common/io/socket/session
include:
- common/io/fdRead
- common/io/read
# ----------------------------------------------------------------------------------------------------------------------------
- name: io-http
total: 5
coverage:
- common/io/http/client
- common/io/http/common
- common/io/http/header
- common/io/http/query
- common/io/http/request
- common/io/http/response
- common/io/http/session
# ----------------------------------------------------------------------------------------------------------------------------
- name: compress
total: 5
coverage:
- common/compress/bz2/common
- common/compress/bz2/compress
- common/compress/bz2/decompress
- common/compress/gz/common
- common/compress/gz/compress
- common/compress/gz/decompress
- common/compress/lz4/common
- common/compress/lz4/compress
- common/compress/lz4/decompress
- common/compress/zst/common
- common/compress/zst/compress
- common/compress/zst/decompress
- common/compress/helper
# ----------------------------------------------------------------------------------------------------------------------------
- name: crypto
total: 3
coverage:
- common/crypto/cipherBlock
- common/crypto/common
- common/crypto/hash
- common/crypto/md5.vendor
# ----------------------------------------------------------------------------------------------------------------------------
- name: exec
total: 1
coverage:
- common/exec
# ----------------------------------------------------------------------------------------------------------------------------
- name: encode
total: 1
coverage:
- common/encode
- common/encode/base64
# ----------------------------------------------------------------------------------------------------------------------------
- name: reg-exp
total: 3
coverage:
- common/regExp
# ----------------------------------------------------------------------------------------------------------------------------
- name: ini
total: 4
coverage:
- common/ini
# ********************************************************************************************************************************
- name: postgres
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: client
total: 1
coverage:
- postgres/client
# ----------------------------------------------------------------------------------------------------------------------------
- name: interface
total: 9
coverage:
- postgres/interface
- postgres/interface/page
# ********************************************************************************************************************************
- name: config
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: parse
total: 6
coverage:
- config/config
- config/parse
- config/parse.auto: noCode
include:
- common/log
# ----------------------------------------------------------------------------------------------------------------------------
- name: load
total: 4
coverage:
- config/load
include:
- common/log
- common/io/socket/common
# ----------------------------------------------------------------------------------------------------------------------------
- name: exec
total: 1
coverage:
- config/exec
# ----------------------------------------------------------------------------------------------------------------------------
- name: protocol
total: 1
coverage:
- config/protocol
# ********************************************************************************************************************************
- name: storage
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: azure
total: 3
coverage:
- storage/azure/read
- storage/azure/storage
- storage/azure/write
- storage/helper
include:
- storage/storage
- storage/write
# ----------------------------------------------------------------------------------------------------------------------------
- name: cifs
total: 1
coverage:
- storage/cifs/storage
- storage/posix/storage
- storage/helper
include:
- storage/storage
# ----------------------------------------------------------------------------------------------------------------------------
- name: posix
total: 21
coverage:
- storage/posix/read
- storage/posix/storage
- storage/posix/write
- storage/helper
- storage/read
- storage/storage
- storage/write
# ----------------------------------------------------------------------------------------------------------------------------
- name: remote
total: 9
containerReq: true
binReq: true
coverage:
- storage/remote/read
- storage/remote/protocol
- storage/remote/storage
- storage/remote/write
- storage/helper
- storage/storage
include:
- storage/read
- storage/write
# ----------------------------------------------------------------------------------------------------------------------------
- name: s3
total: 2
coverage:
- storage/s3/read
- storage/s3/storage
- storage/s3/write
- storage/helper
- storage/storage
include:
- storage/write
# ********************************************************************************************************************************
- name: protocol
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: protocol
total: 10
containerReq: true
binReq: true
coverage:
- protocol/client
- protocol/command
- protocol/helper
- protocol/parallel
- protocol/parallelJob
- protocol/server
include:
- common/exec
# ********************************************************************************************************************************
- name: info
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: info
total: 3
coverage:
- info/info
# ----------------------------------------------------------------------------------------------------------------------------
- name: info-pg
total: 2
coverage:
- info/infoPg
# ----------------------------------------------------------------------------------------------------------------------------
- name: info-archive
total: 2
coverage:
- info/infoArchive
# ----------------------------------------------------------------------------------------------------------------------------
- name: info-backup
total: 3
coverage:
- info/infoBackup
# ----------------------------------------------------------------------------------------------------------------------------
- name: manifest
total: 6
coverage:
- info/manifest
# ********************************************************************************************************************************
- name: db
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: db
total: 3
containerReq: true
binReq: true
coverage:
- db/db
- db/helper
- db/protocol
# ********************************************************************************************************************************
- name: command
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: archive-common
total: 9
coverage:
- command/archive/common
# ----------------------------------------------------------------------------------------------------------------------------
- name: archive-get
total: 3
binReq: true
coverage:
- command/archive/common
- command/archive/get/file
- command/archive/get/get
- command/archive/get/protocol
# ----------------------------------------------------------------------------------------------------------------------------
- name: archive-push
total: 4
binReq: true
coverage:
- command/archive/common
- command/archive/push/file
- command/archive/push/protocol
- command/archive/push/push
# ----------------------------------------------------------------------------------------------------------------------------
- name: backup-common
total: 3
coverage:
- command/backup/common
- command/backup/pageChecksum
# ----------------------------------------------------------------------------------------------------------------------------
- name: backup
total: 10
binReq: true
coverage:
- command/backup/backup
- command/backup/common
- command/backup/file
- command/backup/protocol
include:
- info/info
- info/manifest
- storage/storage
# ----------------------------------------------------------------------------------------------------------------------------
- name: check
total: 4
containerReq: true
coverage:
- command/check/common
- command/check/check
# ----------------------------------------------------------------------------------------------------------------------------
- name: command
total: 1
coverage:
- command/command
# ----------------------------------------------------------------------------------------------------------------------------
- name: control
total: 3
coverage:
- command/control/common
- command/control/start
- command/control/stop
# ----------------------------------------------------------------------------------------------------------------------------
- name: expire
total: 8
coverage:
- command/expire/expire
include:
- info/infoBackup
# ----------------------------------------------------------------------------------------------------------------------------
- name: help
total: 4
coverage:
- command/help/help
- command/help/help.auto: noCode
# ----------------------------------------------------------------------------------------------------------------------------
- name: info
total: 3
coverage:
- command/info/info
# ----------------------------------------------------------------------------------------------------------------------------
- name: local
total: 1
coverage:
- command/local/local
# ----------------------------------------------------------------------------------------------------------------------------
- name: remote
total: 1
coverage:
- command/remote/remote
# ----------------------------------------------------------------------------------------------------------------------------
- name: restore
total: 12
binReq: true
coverage:
- command/restore/file
- command/restore/protocol
- command/restore/restore
include:
- common/user
- info/infoBackup
- info/manifest
# ----------------------------------------------------------------------------------------------------------------------------
- name: stanza
total: 5
coverage:
- command/stanza/common
- command/stanza/create
- command/stanza/upgrade
- command/stanza/delete
# ----------------------------------------------------------------------------------------------------------------------------
- name: repo
total: 4
coverage:
- command/repo/get
- command/repo/ls
- command/repo/put
- command/repo/rm
include:
# command/repo/create is currently for testing purposes only so coverage is not provided except in integration. In the
# future this will probably be rolled into a custom object store server implementation.
- command/repo/create
# ----------------------------------------------------------------------------------------------------------------------------
- name: verify
total: 6
binReq: true
coverage:
- command/verify/file
- command/verify/protocol
- command/verify/verify
# **********************************************************************************************************************************
# Integration tests
#
# Integration tests are not run in a container. They are expected to create their own containers since most integration runs will
# create more than one. For this reason each run is executed individually.
# **********************************************************************************************************************************
integration:
# ********************************************************************************************************************************
- name: mock
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: stanza
total: 2
# ----------------------------------------------------------------------------------------------------------------------------
- name: expire
total: 2
# ----------------------------------------------------------------------------------------------------------------------------
- name: archive
total: 2
# ----------------------------------------------------------------------------------------------------------------------------
- name: archive-stop
total: 2
# ----------------------------------------------------------------------------------------------------------------------------
- name: all
total: 2
# ********************************************************************************************************************************
- name: real
db: true
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: all
total: 1
# **********************************************************************************************************************************
# Performance tests
#
# Performance tests run in a single container but are more like integration tests than unit tests since they call the pgbackrest
# executable directly.
# **********************************************************************************************************************************
performance:
# ********************************************************************************************************************************
- name: performance
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: archive-perl
total: 1
test:
# ----------------------------------------------------------------------------------------------------------------------------
- name: type
total: 5
# ----------------------------------------------------------------------------------------------------------------------------
- name: storage
total: 2
include:
- storage/helper