Bläddra i källkod

Easier debugging (#5135)

Nate 5 år sedan
förälder
incheckning
d9bf2585c6
2 ändrade filer med 10 tillägg och 3 borttagningar
  1. 7 2
      deployment/vagrant/Vagrantfile
  2. 3 1
      toolset/benchmark/benchmarker.py

+ 7 - 2
deployment/vagrant/Vagrantfile

@@ -13,7 +13,12 @@ Vagrant.configure("2") do |config|
   end
   end
 
 
   config.vm.network "private_network", ip: "172.16.0.16"
   config.vm.network "private_network", ip: "172.16.0.16"
-  config.vm.network :forwarded_port, guest: 8080, host: 28080
+
+  TCP_PORTS = [2001, 3000, 8000, 8080, 8081, 8082, 8085, 9000]
+
+  TCP_PORTS.each do |port|
+      config.vm.network :forwarded_port, guest: port, host: 20000 + port
+  end
 
 
   provision_bootstrap(config)
   provision_bootstrap(config)
   provider_virtualbox(config)
   provider_virtualbox(config)
@@ -24,5 +29,5 @@ Vagrant.configure("2") do |config|
   config.vm.provider "virtualbox" do |vb|
   config.vm.provider "virtualbox" do |vb|
     vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
     vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
   end
   end
-  
+
 end
 end

+ 3 - 1
toolset/benchmark/benchmarker.py

@@ -175,7 +175,9 @@ class Benchmarker:
 
 
             # Debug mode blocks execution here until ctrl+c
             # Debug mode blocks execution here until ctrl+c
             if self.config.mode == "debug":
             if self.config.mode == "debug":
-                log("Entering debug mode. Server has started. CTRL-c to stop.",
+                msg = "Entering debug mode. Server http://localhost:%s has started. CTRL-c to stop.\r\n" % test.port
+                msg = msg + "From outside vagrant: http://localhost:%s" % (int(test.port) + 20000)
+                log(msg,
                     prefix=log_prefix,
                     prefix=log_prefix,
                     file=benchmark_log,
                     file=benchmark_log,
                     color=Fore.YELLOW)
                     color=Fore.YELLOW)