Relevant link: https://github.com/freeipa/freeipa-webui/pull/186
I am trying to run cypress
tests on ipa
server installed in Vagrant. I output the Vagrant's IP after the installation to /etc/hosts
, which, I presume, is a host file used by GitHub runner.
However, cypress
does not seem to be able to find the running server.
Previously (about a month ago), the runners were using 192.168.x.y
IP and the vagrant provisioning has been consistently running on an assigned static address. This has changed recently and the vagrant provisioning is running on 10.0.x.y
address. With 192.168.x.y
address, cypress
had no issue finding the server.
What I tried:
http
andhttps
forbaseUrl
param of cypress config- setting
host
with the IP as aenv
param for cypress step (seegating.yml
in the PR above) - using
wait-on
with server's url (server.ipa.demo
) ingating.yml
Relevant code:
e2e: {
specPattern: "**/*.feature",
baseUrl: "http://server.ipa.demo",
- name: Cache Vagrant boxes
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
- name: Cleanup running Vagrant boxes in case they are running
run: vagrant destroy --force
- name: Run vagrant up
run: vagrant up --no-provision
- name: Run vagrant provision
run: vagrant provision
- name: Put IPA Server's IP to /etc/hosts
run: sudo echo "$(vagrant ssh -c "hostname -I") server.ipa.demo" | sudo tee -a /etc/hosts
- name: Save server's IP address to env
run: echo "SERVER_IP=$(vagrant ssh -c "hostname -I")" >> $GITHUB_ENV
- name: Print exported variable
run: echo "$SERVER_IP"
- name: Run Cypress tests
uses: cypress-io/github-action@v6
with:
browser: firefox
env: host="https://${{ env.SERVER_IP }}"
The error:
Cypress could not verify that this server is running:
> https://server.ipa.demo/
We are verifying this server because it has been configured as your baseUrl.
Cypress automatically waits until your server is accessible before running tests.
We will try connecting to it 3 more times...
We will try connecting to it 2 more times...
We will try connecting to it 1 more time...
I have managed to resolve this issue using following steps:
mac-os
runner byubuntu
.When running
Vagrant
frommac-os
, Vagrant was assigned only10.0.2.15
address, which was not usable for connecting to the server running inVagrant
.When using
ubuntu
,Vagrant
gets assigned both10.0.2.15
and192.168.x.y
addresses, where192...
works in the internal network./etc/hosts
, I have used following stepYou can see PR#186 for details.