Skip to content

v.util.vtest #

redis_default_port is the port, that a redis-server listens on by default. The db.redis tests connect to it.

fn filter_vtest_only #

fn filter_vtest_only(paths []string, config FilterVTestConfig) []string

if VTEST_ONLY env var is set, returns tests that match the query

fn is_default_port_redis_server #

fn is_default_port_redis_server(process_line string) bool

is_default_port_redis_server reports whether process_line, a line of ps ax, is a redis-server, that the db.redis tests can reach on the default port 6379. By default, redis-server rewrites its process title to show its listening address (redis-server *:6379). With set-proc-title no, the title keeps the original arguments instead, where --port can name the port. A server is ruled out only by a port that its line shows; redis-server /etc/redis/redis.conf counts.

fn is_ownership_autofree_test #

fn is_ownership_autofree_test(path string) bool

is_ownership_autofree_test reports whether a test file exercises ownership or autofree. That is the case when the file is in an ownership folder, its name contains ownership or autofree, its // vtest vflags: line enables one of these modes, or it has a // vtest ownership line. Like the other // vtest directives, both lines must start at the beginning of a line. Flags elsewhere in the source do not count: many tests pass them to a compiler only to check how they are parsed or rejected.

fn skip_ownership_autofree_tests #

fn skip_ownership_autofree_tests() bool

skip_ownership_autofree_tests reports whether ownership/autofree test coverage is disabled. GitHub Actions disables it globally; local and other CI runs can opt in explicitly.

struct FilterVTestConfig #

@[params]
struct FilterVTestConfig {
pub:
	basepath    string
	fix_slashes bool = true
}