Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
79369d73
Commit
79369d73
authored
2 years ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
test: picodata test --nocapture & PICODATA_TEST_* variables
parent
95f6fe7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!256
test: picodata test --nocapture & PICODATA_TEST_* variables
Pipeline
#12186
failed
2 years ago
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/args.rs
+5
-1
5 additions, 1 deletion
src/args.rs
src/main.rs
+13
-5
13 additions, 5 deletions
src/main.rs
with
18 additions
and
6 deletions
src/args.rs
+
5
−
1
View file @
79369d73
...
...
@@ -229,9 +229,13 @@ impl Expel {
#[derive(Debug,
Parser,
tlua::Push)]
#[clap(about
=
"Run picodata integration tests"
)]
pub
struct
Test
{
#[clap()]
#[clap(
env
=
"PICODATA_TEST_FILTER"
)]
/// Only run tests matching the filter.
pub
filter
:
Option
<
String
>
,
#[clap(long
=
"nocapture"
,
env
=
"PICODATA_TEST_NOCAPTURE"
)]
/// Do not capture test output.
pub
nocapture
:
bool
,
}
impl
Test
{
...
...
This diff is collapsed.
Click to expand it.
src/main.rs
+
13
−
5
View file @
79369d73
...
...
@@ -942,8 +942,10 @@ fn main_test(args: args::Test) -> ! {
ForkResult
::
Child
=>
{
drop
(
rx
);
unistd
::
close
(
0
)
.ok
();
// stdin
unistd
::
dup2
(
*
tx
,
1
)
.ok
();
// stdout
unistd
::
dup2
(
*
tx
,
2
)
.ok
();
// stderr
if
!
args
.nocapture
{
unistd
::
dup2
(
*
tx
,
1
)
.ok
();
// stdout
unistd
::
dup2
(
*
tx
,
2
)
.ok
();
// stderr
}
drop
(
tx
);
let
rc
=
tarantool_main!
(
...
...
@@ -959,9 +961,11 @@ fn main_test(args: args::Test) -> ! {
let
log
=
{
let
mut
buf
=
Vec
::
new
();
use
std
::
io
::
Read
;
rx
.read_to_end
(
&
mut
buf
)
.map_err
(|
e
|
println!
(
"error reading ipc pipe: {e}"
))
.ok
();
if
!
args
.nocapture
{
rx
.read_to_end
(
&
mut
buf
)
.map_err
(|
e
|
println!
(
"error reading ipc pipe: {e}"
))
.ok
();
}
buf
};
...
...
@@ -981,6 +985,10 @@ fn main_test(args: args::Test) -> ! {
println!
(
"{FAILED}"
);
cnt_failed
+=
1
;
if
args
.nocapture
{
continue
;
}
use
std
::
io
::
Write
;
println!
();
std
::
io
::
stderr
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment