DEV Community

Chokri K'
Chokri K'

Posted on • Originally published at khalifa.tn on

1

Gitlab-CI using Panther and Symfony 4

I tried to test my Symfony 4.1 app using gitlab-ci. Basically, when we Test PHP application we require php-cli docker image to execute composer install, phpunit.

But in this case I have a node packages to install, a React App in the front to test and a Rest API to test with my React Application.

I created a simple Symfony 4.1 App using React Routes in front and I execute a fetch to get a JSON from ApiController.

I made a TestCase using Panther to test it locally and it works perfectly.

It tooks 9 secondes because in the controller I wrote sleep 8 secondes before returning the Response.

Then, I want to test my app using Gitlab-CI, when I push an update I want to be sure that everything is fine and I can safely deploy my app on production.

I write a gitlab-ci to test the app, and it fails… it fails… it fails… I check the log and I try… Finally I decided to write my own Docker image and test my app with it.

I made this Docker image base on Ubuntu 18.04. It contains PHP 7.2 andNode JS.

To be able to run Panther Unit Tests, we need to install 3 packages, (ZIP, Libnss3 and chromium-browser). All these stuffs are available in one place. The problem is that the size of the image is about 1.18GB !!

With this docker image I’m now able to run CI tests on gitlab.

The post Gitlab-CI using Panther and Symfony 4 appeared first on C.Khalifa.

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay