Skip to content

Commit

Permalink
vagrant: ubuntu 20.04 test
Browse files Browse the repository at this point in the history
  • Loading branch information
ponty committed Oct 14, 2020
1 parent e73dda2 commit f972031
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ MANIFEST

*.log

Vagrantfile.*
Vagrantfile.osx.*
Vagrantfile.win.*
23 changes: 14 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Vagrant.configure(2) do |config|

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/bionic64"
config.vm.box = "ubuntu/focal64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
Expand Down Expand Up @@ -44,13 +44,18 @@ Vagrant.configure(2) do |config|
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
vb.name = "pyvirtualdisplay_1804"
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# Customize the amount of memory on the VM:
vb.memory = "2048"
end
# Display the VirtualBox GUI when booting the machine
#vb.gui = true

# Customize the amount of memory on the VM:
# vb.memory = "2048"

vb.name = "pyvirtualdisplay_2004"

# https://bugs.launchpad.net/cloud-images/+bug/1829625
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
vb.customize ["modifyvm", :id, "--uartmode1", "file", "./ttyS0.log"]
end
#
# View the documentation for the provider you are using for more
# information on available options.
Expand Down Expand Up @@ -85,7 +90,7 @@ Vagrant.configure(2) do |config|
# sudo apt-get install -y libjpeg-dev zlib1g-dev
# project dependencies
sudo apt-get install -y xvfb xserver-xephyr vnc4server
sudo apt-get install -y xvfb xserver-xephyr tigervnc-standalone-server
# as py27 pyscreenshot backend
sudo apt-get install -y scrot
Expand Down
3 changes: 2 additions & 1 deletion Vagrantfile.14.04.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# vb.gui = true
#
# Customize the amount of memory on the VM:
vb.memory = "2048"
# vb.memory = "2048"
end
#
# View the documentation for the provider you are using for more
Expand Down Expand Up @@ -105,6 +105,7 @@
"
config.vm.provision "shell", inline: $script

config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"]

end

Expand Down
114 changes: 114 additions & 0 deletions Vagrantfile.18.04.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/bionic64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
vb.name = "pyvirtualdisplay_1804"
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# Customize the amount of memory on the VM:
# vb.memory = "2048"
end
#
# View the documentation for the provider you are using for more
# information on available options.

# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
$script = "
export DEBIAN_FRONTEND=noninteractive
echo 'export export LC_ALL=C' >> /home/vagrant/.profile
# install python versions
sudo add-apt-repository --yes ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python2.7-dev
sudo apt-get install -y python3.6-dev
sudo apt-get install -y python3.7-dev
sudo apt-get install -y python3.8-dev
sudo apt-get install -y python3-distutils
# tools
sudo apt-get install -y mc python3-pip xvfb
# for pillow source install
# sudo apt-get install -y libjpeg-dev zlib1g-dev
# project dependencies
sudo apt-get install -y xvfb xserver-xephyr tigervnc-standalone-server
# as py27 pyscreenshot backend
sudo apt-get install -y scrot
# test dependencies
sudo apt-get install -y gnumeric
sudo apt-get install -y x11-utils # for: xmessage
sudo apt-get install -y x11-apps # for: xlogo
sudo pip3 install tox
# doc dependencies
sudo apt-get install -y npm xtightvncviewer
sudo npm install -g npx
# sudo pip install -r /vagrant/requirements-doc.txt
"
config.vm.provision "shell", inline: $script

config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"]


end


# export VAGRANT_VAGRANTFILE=Vagrantfile.18.04.rb;export VAGRANT_DOTFILE_PATH=.vagrant_${VAGRANT_VAGRANTFILE}
# vagrant up && vagrant ssh
5 changes: 4 additions & 1 deletion tests/tutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ def kill_process_tree(ep):
parent_pid = ep.pid
parent = psutil.Process(parent_pid)
for child in parent.children(recursive=True):
child.kill()
try:
child.kill()
except psutil.NoSuchProcess:
log.warning("NoSuchProcess error in kill_process_tree")
parent.kill()
8 changes: 6 additions & 2 deletions tests/vagrant/vagrant_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ def run_box(options, vagrantfile, cmds):


config = {
"server": ("Vagrantfile", ["tox"],),
"server1404": ("Vagrantfile.14.04.rb", ["tox -e py27", "tox -e py36"],),
"server2004": ("Vagrantfile", ["tox"],),
"server1804": ("Vagrantfile.18.04.rb", ["tox"],),
"server1404": (
"Vagrantfile.14.04.rb",
["tox -e py36"], # "tox -e py27" -> SSL error
),
"osx": ("Vagrantfile.osx.rb", ["bash --login -c 'python3 -m tox -e py3-osx'"],),
}

Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ envlist =
py36
py37
py38
py3-doc

# Workaround for Vagrant
#toxworkdir={toxinidir}/.tox # default
Expand Down

0 comments on commit f972031

Please sign in to comment.