Home > front end >  Gitlab-CI Laravel unit testing fails online but works locally
Gitlab-CI Laravel unit testing fails online but works locally

Time:01-04

I have a similar issue as in this post: My unit/feature test work locally, but fail online. I have already figured out that the test which fail are probably related to the Laravel Storage API which is used with the local driver.

This is the code is suspect is causing issues.

            // DELETE IF EXISTS
            if (Storage::exists($path))
                Storage::delete($path);

            // COPY BOILERPLATE
            Storage::copy('bp-template.py', $path);

            // APPEND
            Storage::append($path, $validator['complexFormula']);

In my .env.testing file, I have set

FILESYSTEM_DRIVER=local

I created the docker image for testing by following these instructions.

CodePudding user response:

As @BrianThompson suggested, I implemented a mock storage disk which solved my problem.

  •  Tags:  
  • Related