Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to execute PHP's HTTP tests on pipelines

Alysson H_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2023

Good morning,

We want to configure a pipeline for one of our projects, we are occuring an issue related to Bitbucket's Pipeline.

On a given step, we want to perform tests:

  • units tests are fine and all of them are good 
  • every test which run a HTTP request fails each time.

There is our step:

- step: &Tests
name: Build Prisma to perform tests
service:
- docker
cache:
- composer
- docker
script:
- eval $(cat secrets.def | sed 's/^/export /')
- pecl install xdebug
- docker-php-ext-enable xdebug
- export XDEBUG_MODE=coverage
- >-
curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s \
zip
- cp .env.testing .env
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- export APP_URL="http://host.docker.internal:8000"
- php artisan key:generate
- php artisan migrate
- php artisan optimize && php artisan optimize:clear
- echo "memory_limit = 512M" > $PHP_INI_DIR/conf.d/php-memory-limits.ini
- php artisan test --coverage
artifacts:
- secrets.def

And this is the result:

Screenshot from 2023-09-21 11-58-15.png

 

We watched on host.docker.internal (it changes nothing), also increase the available memory, same result.

I hope there is someone to help us.

Thank you,

Alysson

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2023

Hi Alysson,

Based on the output you posted here, the error seems to be related to your source code rather than an issue with Pipelines.

At the end of the screenshot, the following error is mentioned

TypeError: Unsupported operand types: string * int in <...>

along with the path of a file. I would suggest starting by checking this specific file.

/opt/atlassian/pipelines/agent/build is the path where the repo is cloned in the Docker container where the build is running. The rest should be the path of this file in your repo unless you generate this file during the build.

Kind regards,
Theodora

Alysson H_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 10, 2023

Hello @Theodora Boudale 

Thank you for your answer, I was in holidays, my collegues did read your response and continue digging. They find a difference between development branch and our pipelines ; an environment variable was empty for PHP (SESSION_LIFETIME).

They also seperated php's server and vite too, the first one was not running because `npm run dev` took priority. It works fine now.

Thank you

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2023

Thank you for the update Alysson, it's good to hear that the issue is resolved now!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events