Эх сурвалжийг харах

cli: Add NODE_OPTIONS env variable with DNS fix (#915)

Kirill Fomichev 4 жил өмнө
parent
commit
95d46976d4
2 өөрчлөгдсөн 12 нэмэгдсэн , 1 устгасан
  1. 1 1
      .travis.yml
  2. 11 0
      cli/src/lib.rs

+ 1 - 1
.travis.yml

@@ -5,7 +5,7 @@ rust:
 cache: cargo
 env:
   global:
-    - NODE_VERSION="14.7.0"
+    - NODE_VERSION="17.0.1"
     - SOLANA_CLI_VERSION="1.7.11"
 git:
   submodules: true

+ 11 - 0
cli/src/lib.rs

@@ -1477,6 +1477,16 @@ fn test(
 
         let url = cluster_url(cfg);
 
+        let node_options = format!(
+            "{} --dns-result-order=ipv4first",
+            match std::env::var_os("NODE_OPTIONS") {
+                Some(value) => value
+                    .into_string()
+                    .map_err(std::env::VarError::NotUnicode)?,
+                None => "".to_owned(),
+            }
+        );
+
         // Setup log reader.
         let log_streams = stream_logs(cfg, &url);
 
@@ -1497,6 +1507,7 @@ fn test(
                 .args(args)
                 .env("ANCHOR_PROVIDER_URL", url)
                 .env("ANCHOR_WALLET", cfg.provider.wallet.to_string())
+                .env("NODE_OPTIONS", node_options)
                 .stdout(Stdio::inherit())
                 .stderr(Stdio::inherit())
                 .output()