jazzband / sorl-thumbnail

Thumbnails for Django
https://sorl-thumbnail.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.74k stars 495 forks source link

Running tests locally with vagrant box not working #671

Closed paul-hansen closed 2 years ago

paul-hansen commented 3 years ago

Summary

Following the instructions for running the tests locally does not work as the vagrant box is broken.

Suggested actions

I would recommend either fixing this or removing it if it is no longer used by anyone as it's a trap for new contributors. If removed we should provide replacement instructions on how we expect tests to be run. (Do we just commit to GH so the GH action runs? or is there another way to test locally?)

Steps I have tried so far

Out of the box

Without changes running vagrant up from the project directory returns:

C:\dev\sorl-thumbnail>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'precise64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
There was an error while downloading the metadata for this box.
The error message is shown below:

Could not resolve host: files.vagrantup.com

This looks like it's because box_url was set manually to a link that is now dead.

Using "hashicorp/precise64" box

I tried changing the Vagrantfile to use https://app.vagrantup.com/hashicorp/boxes/precise64 instead:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
  config.vm.provision :shell, :path => "vagrant.sh"
end

I get a ton of 404 errors when it tries to update via apt-get I'm guessing because precise64 is ancient and the sources list is old. Here's the full output: https://gist.github.com/paul-hansen/29828b08b65f39650cef50fb555a076b

Using Ubuntu 20.04

Since the gitub actions are using ubuntu latest I figured it should work with Ubuntu 20.04, so instead of trying to get Ubuntu 12 working again I would just update to something that works more out of the box. I got it running but most of the tests are failing and I don't understand why yet. Here's the changes I made to get it working: https://github.com/jazzband/sorl-thumbnail/compare/master...paul-hansen:fix-vagrant To try it you need to run this from the project directory:

vagrant up
vagrant ssh
sudo tox --workdir /../.tox

Which runs but most of the tests fail and I'm not sure why. Here's some of the output before I killed it https://gist.github.com/paul-hansen/612c27f0d0727cf689b824c8b8cd7cca

At this point I'm a long ways in and not sure if I'm trying to do something that should be done or if there is a better way people are using. If someone can help point me in the right direction that would be much appreciated. I would like to be able to get setup to contribute and see if I can come up with a working solution for this issue which has caused us problems after updating to the latest version.

paul-hansen commented 2 years ago

Going through and cleaning up my open issues across github. I no longer use this library in my active projects so I don't have interest in contributing anymore.