mirror of
https://github.com/vlang/v.git
synced 2025-09-24 04:48:28 -04:00
tools: make v test
detect a running redis server too, and make that info available to the individual tests through // vtest build: present_redis?
This commit is contained in:
parent
a5d7f36691
commit
4645db3ec4
@ -904,6 +904,9 @@ pub const is_started_mysqld = find_started_process('mysqld') or { '' }
|
|||||||
// is_started_postgres is true, when the test runner determines that there is a running postgres server
|
// is_started_postgres is true, when the test runner determines that there is a running postgres server
|
||||||
pub const is_started_postgres = find_started_process('postgres') or { '' }
|
pub const is_started_postgres = find_started_process('postgres') or { '' }
|
||||||
|
|
||||||
|
// is_started_redis is true, when the test runner determines that there is a running redis server
|
||||||
|
pub const is_started_redis = find_started_process('redis-server') or { '' }
|
||||||
|
|
||||||
pub fn (mut ts TestSession) setup_build_environment() {
|
pub fn (mut ts TestSession) setup_build_environment() {
|
||||||
facts, mut defines := pref.get_build_facts_and_defines()
|
facts, mut defines := pref.get_build_facts_and_defines()
|
||||||
// add the runtime information, that the test runner has already determined by checking once:
|
// add the runtime information, that the test runner has already determined by checking once:
|
||||||
@ -913,6 +916,9 @@ pub fn (mut ts TestSession) setup_build_environment() {
|
|||||||
if is_started_postgres != '' {
|
if is_started_postgres != '' {
|
||||||
defines << 'started_postgres'
|
defines << 'started_postgres'
|
||||||
}
|
}
|
||||||
|
if is_started_redis != '' {
|
||||||
|
defines << 'started_redis'
|
||||||
|
}
|
||||||
if is_node_present {
|
if is_node_present {
|
||||||
defines << 'present_node'
|
defines << 'present_node'
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// vtest build: present_redis?
|
// vtest build: started_redis?
|
||||||
import db.redis
|
import db.redis
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user