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

Update tests to make them runnable on M1 Mac #148

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
ref: refs/tags/${{ github.event.inputs.version }}
if: github.event.inputs.version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set version from tag/branch
run: |
echo "RELEASE_VERSION=$GITHUB_REF_NAME" >>"$GITHUB_ENV"
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build-golang-executable:

build-online-zip:
$(CLIENT) build \
--platform linux/amd64 \
-t mirror-registry-online:${RELEASE_VERSION} \
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
--build-arg QUAY_IMAGE=${QUAY_IMAGE} \
Expand All @@ -29,6 +30,7 @@ build-online-zip:

build-offline-zip:
$(CLIENT) build \
--platform linux/amd64 \
-t mirror-registry-offline:${RELEASE_VERSION} \
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
--build-arg QUAY_IMAGE=${QUAY_IMAGE} \
Expand Down
11 changes: 10 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ VERSION := dev-$(TREEISH)
# from.
OLD_VERSION := 1.2.9

# VAGRANT_UP_ARGS allows to provide additional arguments to `vagrant up`.
# Example:
# make test-install VAGRANT_UP_ARGS='--provider=qemu'
ifeq ($(shell uname -s) $(shell uname -m),Darwin arm64)
VAGRANT_UP_ARGS := --provider=qemu
else
VAGRANT_UP_ARGS :=
endif

all: test-install test-sudo-install test-sudo-upgrade

# mirror-registry archive from the current repository.
Expand All @@ -36,7 +45,7 @@ $(MAKE) start-vagrant && (set -x; $(1)); ret=$$?; $(MAKE) stop-vagrant && exit $
endef

start-vagrant:
vagrant up
vagrant up $(VAGRANT_UP_ARGS)

stop-vagrant:
ifneq ($(DEBUG), 1)
Expand Down
22 changes: 21 additions & 1 deletion test/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "generic/fedora37"
config.vm.box = "generic/fedora36"
config.vm.box_architecture = "amd64"
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 8443, host: 8443
config.vm.provider "virtualbox" do |vb|
vb.memory = "3072"
end
config.vm.provider "qemu" do |qe|
qe.arch = "x86_64"
qe.machine = "q35"
qe.cpu = "max"
qe.smp = "cpus=4,sockets=1,cores=4,threads=1"
qe.memory = "3072"
qe.net_device = "virtio-net-pci"
qe.extra_qemu_args = %w(-accel tcg,thread=multi,tb-size=512)
qe.forward_port("guestssh", 22, 50021, auto: true)
end
config.vm.provision "shell", inline: <<-SHELL
set -x
# On macOS with qemu, the systemd-resolved does not work properly. To work
# around this issue, we disable the systemd-resolved and use Google's DNS.
systemctl stop systemd-resolved
systemctl disable systemd-resolved
rm -f /etc/resolv.conf
echo "nameserver 8.8.8.8" >/etc/resolv.conf
dnf install -y \
acl \
openssl \
Expand Down
Loading