parse-community / parse-php-sdk

The PHP SDK for Parse Platform
https://parseplatform.org/
Other
812 stars 346 forks source link

Run tests based on CONTRIBUTING not working #474

Closed igor-mobapps closed 3 years ago

igor-mobapps commented 3 years ago

Issue Description

Hi, I tried to run the parse-php-sk tests based on the description of CONTRIBUTING and got several errors.

Contributing: https://github.com/parse-community/parse-php-sdk/blob/master/CONTRIBUTING.md

When running npm start, the first error that is caught is Response code 403 which is linked to the mongodb-runner

Problem description: https://github.com/mongodb-js/runner/issues/162

Solution that worked for me:

Change the version of MONGODB_VERSION from 4.0.4 to 4.4.6 in package.json

"prestart": "MONGODB_VERSION=4.4.6 MONGODB_TOPOLOGY=replicaset MONGODB_STORAGE_ENGINE=wiredTiger mongodb-runner start"

After that the error Response code 403 disappeared, but another one appeared

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (50900)

which is also related to the mongodb runner that is described in this PR

Problem description: https://github.com/mongodb-js/runner/issues/177

Solution that worked for me:

Changing the version of the mongodb-runner dependency in package.json from 4.7.2 to 4.8.1, it could be that the latest versions are working as well.

After this change the problems with mongodb-runner disappeared, but another problem appeared that is related to a module that is explicit in the file server.js

Error: Cannot find module '@parse/simple-mailgun-adapter'

I don't know if this module should have been installed or not when running npm install, but for some reason, I can only actually run the tests, after commenting out the code in server.js

  emailAdapter: {
    module: "@parse/simple-mailgun-adapter",
    options: {
      apiKey: "not-a-real-api-key",
      domain: "example.com",
      fromAddress: "example@example.com"
    }
  },

Steps to reproduce


At the root of the project

1 - composer install

2 - npm install

3 - npm start

Environment Details

dplewis commented 3 years ago

Thank you for reporting. The @parse/simple-mailgun-adapter was removed from Parse Server. It will have to be installed separately. I can do a PR to include these changes and update the docs