Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zombienet-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
parity
Mirrored projects
zombienet-sdk
Commits
74fabc44
Unverified
Commit
74fabc44
authored
1 year ago
by
Javier Viola
Browse files
Options
Downloads
Patches
Plain Diff
fmt
parent
f3f89a81
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
crates/provider/src/errors.rs
+1
-1
1 addition, 1 deletion
crates/provider/src/errors.rs
crates/provider/src/native.rs
+15
-8
15 additions, 8 deletions
crates/provider/src/native.rs
with
16 additions
and
9 deletions
crates/provider/src/errors.rs
+
1
−
1
View file @
74fabc44
...
...
@@ -34,7 +34,7 @@ pub enum ProviderError {
#[error(
"IO error: {0}"
)]
IOError
(
std
::
io
::
Error
),
#[error(
"Invalid script_path: {0}"
)]
InvalidScriptPath
(
String
)
InvalidScriptPath
(
String
)
,
}
from_error!
(
...
...
This diff is collapsed.
Click to expand it.
crates/provider/src/native.rs
+
15
−
8
View file @
74fabc44
...
...
@@ -172,7 +172,8 @@ impl<T: FileSystem + Send + Sync> Provider for NativeProvider<T> {
let
_
=
self
.filesystem
.copy
(
&
script_path
,
&
script_path_in_pod
)
.await
.map_err
(|
e
|
ProviderError
::
FSError
(
Box
::
new
(
e
)))
?
;
.await
.map_err
(|
e
|
ProviderError
::
FSError
(
Box
::
new
(
e
)))
?
;
// set as executable
self
.run_command
(
...
...
@@ -336,7 +337,11 @@ impl<T: FileSystem + Send + Sync> Provider for NativeProvider<T> {
)
->
Result
<
(),
ProviderError
>
{
// TODO: log::debug!(format!("cp {} {}", pod_file_path, local_file_path));
let
_
=
self
.filesystem
.copy
(
&
pod_file_path
,
&
local_file_path
)
.await
.map_err
(|
e
|
ProviderError
::
FSError
(
Box
::
new
(
e
)))
?
;
let
_
=
self
.filesystem
.copy
(
&
pod_file_path
,
&
local_file_path
)
.await
.map_err
(|
e
|
ProviderError
::
FSError
(
Box
::
new
(
e
)))
?
;
Ok
(())
}
...
...
@@ -422,9 +427,7 @@ impl<T: FileSystem + Send + Sync> Provider for NativeProvider<T> {
.process_map
.iter
()
.filter
(|(
_
,
process
)|
process
.pid
!=
0
)
.map
(|(
_
,
process
)|
{
process
.pid
.to_string
()
})
.map
(|(
_
,
process
)|
process
.pid
.to_string
())
.collect
();
// TODO: use a crate (or even std) to get this info instead of relying on bash
...
...
@@ -642,7 +645,7 @@ impl<T: FileSystem + Send + Sync> Provider for NativeProvider<T> {
mod
tests
{
use
std
::{
os
::
unix
::
process
::
ExitStatusExt
,
process
::
ExitStatus
};
use
support
::
fs
::
mock
::{
MockFilesystem
,
Operation
,
MockError
};
use
support
::
fs
::
mock
::{
MockError
,
MockFilesystem
,
Operation
};
use
super
::
*
;
use
crate
::
shared
::
types
::{
PodLabels
,
PodMetadata
,
PodSpec
};
...
...
@@ -683,8 +686,12 @@ mod tests {
#[tokio::test]
#[should_panic(expected
=
"FSError(OpError(
\"
create
\"
))"
)]
async
fn
test_fielsystem_usage_fails
()
{
let
mut
native_provider
:
NativeProvider
<
MockFilesystem
>
=
NativeProvider
::
new
(
"something"
,
"./"
,
"/tmp"
,
MockFilesystem
::
with_create_dir_error
(
MockError
::
OpError
(
"create"
.into
())));
let
mut
native_provider
:
NativeProvider
<
MockFilesystem
>
=
NativeProvider
::
new
(
"something"
,
"./"
,
"/tmp"
,
MockFilesystem
::
with_create_dir_error
(
MockError
::
OpError
(
"create"
.into
())),
);
let
_
=
native_provider
.create_namespace
()
.await
.unwrap
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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