Trouble running unit tests and selenium tests

Hello,

I’m new to CircleCI and I’m using some example config files to setup my CI.
I’m having trouble running unit tests and selenium tests

For unit tests I did override the path that includes the tests (these are defined in a submodule, which is included). I have no clue if the unit tests are being ran, but the logging gives me an error:

#!/bin/bash -eo pipefail
mkdir -p ~/phpunit
phpunit --log-junit ~/phpunit/junit.xml tests
/bin/bash: line 1: phpunit: command not found
Exited with code 127

Is there some way I need tot include phpunit in the config.yml?

Next up are the selenium tests. I used this example. ‘Download Selenium’ works just fine. ‘Starting Selenium’ turns out grey (not red, so it doesn’t really fail):

#!/bin/bash -eo pipefail
java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
2017-10-03 15:03:28.264:INFO::main: Logging initialized @388ms to org.seleniumhq.jetty9.util.log.StdErrLog
2017-10-03 15:03:28.467:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-10-03 15:03:28.512:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@3a5ed7a6{/,null,STARTING} has uncovered http methods for path: /
2017-10-03 15:03:28.520:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@3a5ed7a6{/,null,AVAILABLE}
2017-10-03 15:03:28.542:INFO:osjs.AbstractConnector:main: Started ServerConnector@694e1548{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-10-03 15:03:28.543:INFO:osjs.Server:main: Started @668ms
Step was canceled

What’s up with this? Are the tests not found? The selenium.log file includes:

15:03:28.243 INFO - Selenium build info: version: ‘3.5.3’, revision: ‘a88d25fe6b’
15:03:28.244 INFO - Launching a standalone Selenium Server
15:03:28.336 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:03:28.370 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
15:03:28.398 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
15:03:28.399 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
15:03:28.435 INFO - Using the passthrough mode handler
15:03:28.543 INFO - Selenium Server is up and running

This is my current config.yml

version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.2-stretch-browsers
environment:
FLASK_CONFIG: testing
TEST_DATABASE_URL: postgresql://ubuntu@localhost/circle_test?sslmode=disable
- image: circleci/postgres:9.6.5-alpine-ram
environment:
POSTGRES_USER: ubuntu
POSTGRES_DB: circle_test
POSTGRES_PASSWORD: “”
- image: circleci/php:7.1.5
test:
override:
- phpunit deskycore/cms/tests
steps:
- checkout
- run: git submodule update --init deskycore
- run: mv deskycore …/
- run: mkdir …/deskycore/clients
- run: ln -s …/trainstation …/deskycore/clients/trainstation
- run: mkdir test-reports
- run:
name: Download Selenium
command: |
curl -O http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar
- run:
name: Start Selenium
command: |
java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
background: true
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum “tests/requirements.txt” }}
- run:
name: Install Python deps in a venv
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r tests/requirements.txt
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum “tests/requirements.txt” }}
paths:
- “venv”
- store_artifacts:
path: test-reports/
destination: tr1
- store_test_results:
path: test-reports/
- run:
name: Log Unit Tests
command: |
mkdir -p ~/phpunit
phpunit --log-junit ~/phpunit/junit.xml tests
- store_test_results:
path: ~/phpunit
- store_artifacts:
path: ~/phpunit

I’ve also included the build result as an attachement.
I hope I included enough information for someone the help me out.

Never mind, we started our own CI, with Blackjack and hookers!

bender1

3 Likes

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.