polymer test on gitlab CI - polymer

I've got a problem running polymer test on gitlab CI shared runner. I got stuck in Selenium error: no such session when running chromedriver. It didn't appear on running firefox. How can I run polymer test in gitlab CI using xvfb-run -a polymer test to run in chrome browser?
This is my .gitlab-ci.yml file:
image: node:6.9.5
before_script:
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/java-8-debian.list
- echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/java-8-debian.list
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
- echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
- apt-get update -yqqq
- apt-get install -y oracle-java8-installer
- apt-get install -y google-chrome-stable
- apt-get install -y iceweasel
- apt-get install -y xvfb
- npm install -g bower
- npm install -g polymer-cli
- bower install --allow-root
stages:
- build
- test
- deploy
testing:
stage: test
script:
- xvfb-run -a polymer test
only:
- develop
tags:
- docker
This is the error report:
http://pastebin.com/wsVMLc83
Thank you.

Related

Caching setup steps such as installing PHP when using Github Actions

I've got a workflow that has some setup steps that install php with a bunch of extensions & composer.
Is it possible to cache the Install PHP and Install Composer & Dependencies so these steps don't have to happen on every run?
These steps combined take about 4 mins of a 5 min run.
name: Build
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v2
with:
path: ./src
- name: Install PHP
run: |
sudo apt-get update -y && export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
echo "tzdata tzdata/Areas select Europe" >> /tmp/preseed.cfg
echo "tzdata tzdata/Zones/Europe select Berlin" >> /tmp/preseed.cfg
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt-get install php8.1 -y --quiet
sudo apt-get install php8.1-dev libmcrypt-dev php-pear php-xml php8.1-xml -y
sudo pecl channel-update pecl.php.net
sudo apt-get install -y libapache2-mod-php8.1 php8.1-common php8.1-gmp php8.1-curl php8.1-soap php8.1-bcmath php8.1-intl php8.1-mbstring php8.1-xmlrpc php8.1-mysql php8.1-gd php8.1-xml php8.1-cli php8.1-zip
sudo rm /usr/bin/php; sudo ln -sf /usr/bin/php8.1 /usr/bin/php
- name: Install Composer & Dependencies
run: |
cd ./src/ || exit 99
sudo apt-get install -y git zip libzip-dev openssh-client libmcrypt-dev
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
cp auth.json.pipeline auth.json
sudo composer self-update --2
composer install --no-dev --verbose --prefer-dist --no-ansi --no-interaction
I would recommend using Setup PHP and Install PHP Dependencies with Composer GitHub Actions instead of manually installing PHP and Composer with dependencies.
These actions already have a caching mechanism and provide many interesting and valuable things additionally.
For example:
name: PHP
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v3
- uses: 'shivammathur/setup-php#v2'
name: Setup PHP
with:
php-version: '8.1'
- uses: 'ramsey/composer-install#v2'
name: Install Composer & Dependencies
- name: Run Script
run: |
php -v
composer -v
Running this WF on my little test PHP project with few dependencies takes about 30s without cache and 20s when cache exists.
Execution demo: Screenshot.
Cache demo: Screenshot.
In addition, there is a Cache GitHub action that can be used if you need manually cache some things for your workflow.
Learn more about managing caches.

How do you install openssl1.0 in a github action CI workflow on ubuntu-latest/18.04?

I tried adding the following to the github steps in the yaml file from https://github.com/actions/virtual-environments/issues/1307#issuecomment-664989873
steps:
- name: Install openssl&libssl-dev
run: |
sudo apt-get install -y --allow-downgrades openssl=1.0.2g-1ubuntu4.16 libssl-dev=1.0.2g-1ubuntu4.16
- name: Display openssl&libssl-dev versions
run: dpkg -l openssl libssl-dev | grep '^ii' | cut -c5-
But received error Version '1.0.2g-1ubuntu4.16' for 'openssl' was not found
How do I figure out what "old versions" of openssl I can install in at least ubuntu 18.04 for github actions?

TravisCI - Google Chrome stable cannot be authenticated

I'm trying to add TravisCI to my project, but I won't stop getting this error when triggering the builds:
WARNING: The following packages cannot be authenticated!
google-chrome-stable E: There were unauthenticated packages and -y was
used without --allow-unauthenticated apt-get.diagnostics apt-get
install failed The command "sudo -E apt-get -yq --no-install-suggests
--no-install-recommends $(travis_apt_get_options) install google-chrome-stable" failed and exited with 100 during .
I've searched for an answer and I found that adding chrome: stable in the addons section should fix it, but it's still failing. This is the .travis.yml file:
dist: trusty
sudo: false
language: node_js
node_js:
- "10"
addons:
chrome: stable
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
cache:
directories:
- ./node_modules
install:
- cd project/projectName
- npm install
script:
- npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
- npm run e2e -- --protractor-config=e2e/protractor-ci.conf.js
And this is the full log:
Worker information
0.17s0.01s0.00s0.01s
system_info
Build system information
0.00s0.00s6.03s0.00s4.23s0.00s1.26s
docker_mtu_and_registry_mirrors
docker stop/waiting
resolvconf
resolvconf stop/waiting
Adding APT Sources
0.16s$ curl -sSL "https://build.travis-ci.com/files/gpg/google-chrome.asc" | sudo -E apt-key add -
OK
0.01s$ echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a ${TRAVIS_ROOT}/etc/apt/sources.list >/dev/null
7.82s$ travis_apt_get_update
Installing APT Packages
0.50s$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install google-chrome-stable
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
indicator-application libappindicator1 libappindicator3-1 libdbusmenu-glib4
libdbusmenu-gtk3-4 libdbusmenu-gtk4 libindicator3-7 libindicator7
Use 'sudo apt autoremove' to remove them.
Recommended packages:
libu2f-udev libvulkan1
The following packages will be upgraded:
google-chrome-stable
1 upgraded, 0 newly installed, 0 to remove and 303 not upgraded.
Need to get 75.8 MB of archives.
After this operation, 59.1 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
google-chrome-stable
E: There were unauthenticated packages and -y was used without --allow-unauthenticated
apt-get.diagnostics
apt-get install failed
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install google-chrome-stable" failed and exited with 100 during .
Your build has been stopped.
How could I fix this? Also, since the root folder (where the .travis.yml file is) isn't where the app is located (it is under root/project/projectName), I wrote - cd project/projectName before doing the -npm install, I don't know if thats the correct way of doing it, so I'd also like to check that.
Thanks!

Installing ansible 2.6 or older

With 2.6.2, ansible started ignoring config files in world writable dirs, rendering many windows/vagrant setups useless. I try to install Ansible 2.6 or older.
System:
Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-132-generic x86_64)
The propvision.sh states
# Add Ansible Repository & Install Ansible
sudo add-apt-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible && sudo touch /root/ansible_ready
I adapted it to
sudo apt-get install -y ansible=2.6.0 && sudo touch /root/ansible_ready
^^^^^^
but that version was not found. How can I obtain 2.5 or 2.6? I am quite unexperienced with linux and the concept of installing something not by a doubleclick.
For installation of Ansible version 2.6 on Trusty Tahr 14.04 (LTS), proceed with the follow commands:
sudo apt update
sudo apt install -y software-properties-common
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
Add apt source list:
sudo tee -a /etc/apt/sources.list.d/ansible-2.6.list << EOF
deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu trusty main
deb-src http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu trusty main
EOF
Update apt and install Ansible:
sudo apt update
sudo apt install -y ansible

Travis CI, pip, and pygame

I am trying to setup a project with Travis CI. Project also uses pygame. I had multiple attempts to set it up - but it seem to be failing.
The closest I got was following:
.travis.yml:
language: python
python:
- "2.7"
install:
- pip install -r requirements.txt
before_install:
- sudo apt-get update
- sudo apt-get build-dep python-pygame
- sudo apt-get install mercurial
script:
- nosetests tests/*.py
requirements.txt:
Twisted==13.2.0
coverage==3.7.1
nose==1.3.0
hg+http://bitbucket.org/pygame/pygame
wsgiref==0.1.2
zope.interface==4.1.0
Travis CI downloads the pygame package, but the installation hangs:
https://travis-ci.org/ruslanosipov/space/builds/19142164#L390
Any hint?
Solution was as follows:
Create separate .travis_requirements.txt without the pygame.
Change .travis.yml as follows:
language: python
python:
- "2.7"
before_install:
- sudo apt-get update -qq
- sudo apt-get build-dep -qq python-pygame
- sudo apt-get install -qq python-pygame
install:
- pip install -r .travis_requirements.txt
script:
- nosetests tests/*.py
virtualenv:
system_site_packages: true
Main change is using "system_site_packages" setting and installing pygame via apt-get.