Wokes
Wokes

Reputation: 113

CircleCI doesn't import dependency

My CircleCI tests are failing because of a missing dependency, even though my local tests pass just fine:

1) Tests\Feature\NetworkedObjectRegistrationTest::itRegistersNetworkedObjects
    Error: Class 'Ramsey\Uuid\UUID' not found

Dependency is imported in test class:

use App\Models\User;
use App\Models\NetworkedObjectAbility;

use Ramsey\Uuid\UUID;

class NetworkedObjectRegistrationTest extends TestCase
{
    use RefreshDatabase;
    ...

And present in composer.json:

    "require": {
        ...
        "ramsey/uuid": "^3.8"
    },

CircleCI config:

version: 2

jobs:
  build:
    docker:
      - image: circleci/php:7.1-node-browsers
    working_directory: ~/laravel
    steps:
      - checkout
      - run: sudo apt install -y libsqlite3-dev zlib1g-dev
      - run: sudo docker-php-ext-install zip
      - run: sudo composer self-update
      - restore_cache:
          keys:
            - composer-v1-{{ checksum "composer.lock" }}
            - composer-v1-
      - run: composer update
      - run: composer install
      - save_cache:
          key: composer-v1-{{ checksum "composer.lock" }}
          paths:
            - vendor
      - restore_cache:
          keys:
            - node-v1-{{ checksum "package.json" }}
            - node-v1-
      - run: yarn install
      - save_cache:
          key: node-v1-{{ checksum "package.json" }}
          paths:
            - node_modules
      - run: touch storage/testing.sqlite

      - run: php artisan migrate --env=testing --database=sqlite_testing --force
      - run: ./vendor/bin/phpunit

Anyone ran into a similar issue? I'm new to CI so my suspicion is that I messed up the config somehow. Cheers.

Upvotes: 1

Views: 86

Answers (1)

kuba
kuba

Reputation: 3870

The name of the class is Uuid, import it as use Ramsey\Uuid\Uuid.

Upvotes: 3

Related Questions