Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.6.1 test failures #10646

Closed
pvalena opened this issue Feb 4, 2019 · 6 comments
Closed

Ruby 2.6.1 test failures #10646

pvalena opened this issue Feb 4, 2019 · 6 comments

Comments

@pvalena
Copy link
Contributor

pvalena commented Feb 4, 2019

Vagrant version

2.2.3

Host operating system

Fedora Rawhide

Debug output

Failures:
  1) VagrantPlugins::FTPPush::FTPAdapter#upload uploads the file
     Failure/Error: expect(server.files).to include("file")
       expected ["/file"] to include "file"
     # ./test/unit/plugins/pushes/ftp/adapter_test.rb:80:in `block (3 levels) in <top (required)>'
  2) VagrantPlugins::FTPPush::FTPAdapter#upload uploads in passive mode
     Failure/Error: expect(server.file("file")).to be_passive
       expected nil to respond to `passive?`
     # ./test/unit/plugins/pushes/ftp/adapter_test.rb:89:in `block (3 levels) in <top (required)>'
  3) VagrantPlugins::FTPPush::Push#push pushes the files to the server
     Failure/Error: expect(server.files).to eq(%w(Gemfile data.txt))
       expected: ["Gemfile", "data.txt"]
            got: ["/var/www/site/Gemfile", "/var/www/site/data.txt"]
       (compared using ==)
     # ./test/unit/plugins/pushes/ftp/push_test.rb:74:in `block (3 levels) in <top (required)>'
  4) Vagrant::Action::Builtin::BoxAdd with box file directly adds from FTP URL
     Failure/Error: server.add_file(path.basename, path.read)
     NoMethodError:
       undefined method `start_with?' for #<Pathname:temporary.box>
     # /usr/share/gems/gems/fake_ftp-0.3.0/lib/fake_ftp/server.rb:157:in `abspath'
     # /usr/share/gems/gems/fake_ftp-0.3.0/lib/fake_ftp/server.rb:62:in `add_file'
     # ./test/unit/vagrant/action/builtin/box_add_test.rb:52:in `with_ftp_server'
     # ./test/unit/vagrant/action/builtin/box_add_test.rb:151:in `block (3 levels) in <top (required)>'

Steps to reproduce

  1. Install Ruby 2.6.1
  2. rake -f tasks/test.rake test:unit

Notes

Error occured after upgrade to Ruby 2.6.1 from Ruby 2.6.0. Previously the tests passed.

@briancain
Copy link
Member

Hey there @pvalena - I don't have any failures when I run the tests against Ruby 2.6.1. I'll spare you the output but:

brian@localghost:vagrant % bundle exec rake                                                                          ±[master]
...
...
...
Finished in 6 minutes 48 seconds (files took 1.33 seconds to load)
3583 examples, 0 failures, 3 pending

brian@localghost:vagrant % ruby -v                                                                          ±[master]
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]

@briancain
Copy link
Member

Travis also passes: #10648

I suspect there is just something off with your environment. Perhaps maybe make sure you're on master with the latest changes? Thanks for opening the issue however!

@voxik
Copy link
Contributor

voxik commented Feb 5, 2019

All these are FTP test failures and there is, for some reason, used much older fake_ftp on Travis then what @pvalena reported, i.e. 0.1.1 vs 0.3.0. That is the first suspectable difference.

@voxik
Copy link
Contributor

voxik commented Feb 26, 2019

The first three are due to livinginthepast/fake_ftp/pull/42. They could be fixed by:

From 60214f4f66ef4fb864aa535c6dccfe5a8b197de8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <[email protected]>
Date: Tue, 26 Feb 2019 12:17:44 +0100
Subject: [PATCH] Fix fake_ftp 0.3.x compatibility.

fake_ftp introduced support direcotry support, which changes the
behavior:

https://github.com/livinginthepast/fake_ftp/pull/42
---
 test/unit/plugins/pushes/ftp/adapter_test.rb | 4 ++--
 test/unit/plugins/pushes/ftp/push_test.rb    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/unit/plugins/pushes/ftp/adapter_test.rb b/test/unit/plugins/pushes/ftp/adapter_test.rb
index 93888f840..a92cc7422 100644
--- a/test/unit/plugins/pushes/ftp/adapter_test.rb
+++ b/test/unit/plugins/pushes/ftp/adapter_test.rb
@@ -77,7 +77,7 @@ describe VagrantPlugins::FTPPush::FTPAdapter do
         ftp.upload("#{@dir}/file", "/file")
       end
 
-      expect(server.files).to include("file")
+      expect(server.files).to include("/file")
     end
 
     it "uploads in passive mode" do
@@ -86,7 +86,7 @@ describe VagrantPlugins::FTPPush::FTPAdapter do
         ftp.upload("#{@dir}/file", "/file")
       end
 
-      expect(server.file("file")).to be_passive
+      expect(server.file("/file")).to be_passive
     end
   end
 end
diff --git a/test/unit/plugins/pushes/ftp/push_test.rb b/test/unit/plugins/pushes/ftp/push_test.rb
index 83509fb7d..49c08da6f 100644
--- a/test/unit/plugins/pushes/ftp/push_test.rb
+++ b/test/unit/plugins/pushes/ftp/push_test.rb
@@ -71,7 +71,7 @@ describe VagrantPlugins::FTPPush::Push do
 
     it "pushes the files to the server" do
       subject.push
-      expect(server.files).to eq(%w(Gemfile data.txt))
+      expect(server.files).to eq(%w(/var/www/site/Gemfile /var/www/site/data.txt))
     end
 
     it "raises informative exception when too many files to process" do
-- 
2.20.1

The fourth should be fixed by livinginthepast/fake_ftp/pull/56

@voxik
Copy link
Contributor

voxik commented Feb 26, 2019

The patch is here: voxik@60214f4

I have not created PR, because the PR would not have sense without updated fake_ftp fixing the other issue.

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants