Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
258 views
in Technique[技术] by (71.8m points)

php - Laravel Dusk Tests Fail In GitHub CI, But Work Locally

I have spent a long time trying to debug this, but every solution I tried didn't work.

I have a project (here) containerised using docker, and the project itself uses Laravel, Nginx and Dusk.

If i try build the environment and run the dusk tests, they pass. Yet when i push this up to GH, the tests fail. I have dump()ed inside the CI, and it seems to show an empty page (<html><head></head><body></body></html>).

I feel like i've searched the whole internet at this point.

How i run my tests:

$ cd src/copytube
$ npm ci
$ npm run dev
$ composer install
$ docker-compose up -d
$ docker exec copytube_phpfpm php artisan dusk

Don't suppose anyone has any idea as to why/how tests would fail only in the CI? The only difference between local and the CI i can think of is, I use a Mac, whereas the CI uses an ubuntu runner. But even then, because everything is containerised, it shouldn't be a problem

EDIT

On every single test, it errors, saying Element oes not exist, which makes sense becausee the page is just an empty body, the tests can be found here

EDIT 2

The CI failing can be seen here (old action)

I've disabled the dusk tests from running inside the workflow

EDIT 3

D: I'll re-enable the tests so it can be easier to see

EDIT 4

Here's a PR where I enabled the dusk tests in the CI so you can see the errors: https://github.com/ebebbington/copytube/pull/161

question from:https://stackoverflow.com/questions/65910820/laravel-dusk-tests-fail-in-github-ci-but-work-locally

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...