1- use std:: { fs:: read_to_string, path:: Path , time:: Duration } ;
1+ use std:: {
2+ fs:: read_to_string,
3+ path:: { Path , PathBuf } ,
4+ time:: Duration ,
5+ } ;
26
37use newrelic_agent_control:: agent_control:: {
48 defaults:: GENERATED_FOLDER_NAME ,
@@ -18,6 +22,7 @@ use crate::{
1822
1923/// An on-host agent definition that includes filesystem entries should result in the entries being
2024/// created in the appropriate location under the remote directory.
25+ #[ cfg( unix) ] // Skipping windows as directory manager is not yet implemented. TODO: adapt when ready
2126#[ test]
2227fn writes_filesystem_entries ( ) {
2328 let opamp_server = FakeServer :: start_new ( ) ;
@@ -29,7 +34,10 @@ fn writes_filesystem_entries() {
2934 let expected_file_contents = "Hello, world!" ;
3035 let agent_id = "test-agent" ;
3136 let dir_entry = "example-filepath" ;
32- let file_path = "randomdir/randomfile.txt" ;
37+ let file_path = PathBuf :: from ( "randomdir" )
38+ . join ( "randomfile.txt" )
39+ . to_string_lossy ( )
40+ . to_string ( ) ;
3341
3442 create_file (
3543 format ! (
@@ -91,6 +99,7 @@ deployment:
9199/// An on-host agent definition that includes filesystem entries should result in the entries being
92100/// created in the appropriate location under the remote directory and with their contents properly
93101/// rendered from the defined variables.
102+ #[ cfg( unix) ] // Skipping windows as directory manager is not yet implemented. TODO: adapt when ready
94103#[ test]
95104fn complete_render_and_and_write_files_and_dirs ( ) {
96105 let opamp_server = FakeServer :: start_new ( ) ;
@@ -102,8 +111,14 @@ fn complete_render_and_and_write_files_and_dirs() {
102111 let agent_id = "test-agent" ;
103112
104113 // Rendered file paths
105- let yaml_file_path = "randomdir/randomfile.yaml" ;
106- let string_file_path = "randomdir-2/some_string.txt" ;
114+ let yaml_file_path = PathBuf :: from ( "randomdir" )
115+ . join ( "randomfile.yaml" )
116+ . to_string_lossy ( )
117+ . to_string ( ) ;
118+ let string_file_path = PathBuf :: from ( "randomdir-2" )
119+ . join ( "some-string.txt" )
120+ . to_string_lossy ( )
121+ . to_string ( ) ;
107122
108123 // Rendered directory paths
109124 let dir_path = "somedir" ;
0 commit comments