Git Product home page Git Product logo

Comments (7)

SET001 avatar SET001 commented on July 30, 2024 1

tests from appsync-simulator-test-example are passing, yes:

set@set-home ~/www/cloudbeds/appsync-serverless-emulator-example $ npm test

> [email protected] test /home/set/www/cloudbeds/appsync-serverless-emulator-example
> jest --detectOpenHandles

  console.warn node_modules/ascoltatori/node_modules/node-uuid/uuid.js:48
    [SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()

 PASS  __test__/graphql.test.js (18.644s)
  graphql
    ✓ None & Lambda examples (418ms)
    ✓ subscription / mutation / dynamodb (196ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        19.46s, estimated 20s
Ran all test suites.

However when I'm was trying to run tests from my project I was getting few errors without any description. Wrapping state.server = await create(); in try/catch with output of error message in console would save many time for me. This is what this issue about.

from aws-utils.

cbaron avatar cbaron commented on July 30, 2024

@SET001, due to the current implementation of the dynamo emulator, which uses the slow to boot JVM, I have found that the initial run of tests fail, and the second run of tests will succeed. We are looking into using nailgun.

To be clear -- are tests passing for you?

from aws-utils.

SET001 avatar SET001 commented on July 30, 2024

@cbaron is it possible to run local dynamo server and use it for each subsequent tests runs, instead of rerun dymano emulator each time?

from aws-utils.

cbaron avatar cbaron commented on July 30, 2024

@SET001 -- its possible, but we prefer to utilize a separate instance for each set of unit tests so that they can run in parallel in jest without interfering with one another.

from aws-utils.

SET001 avatar SET001 commented on July 30, 2024

its possible

how is it possible? any example?

but we prefer to utilize a separate instance for each

are there any reason you call those tests a unit? an't they integration by the nature?

from aws-utils.

cbaron avatar cbaron commented on July 30, 2024

@SET001 You are welcome to write your own test implementation which calls create once. Certainly, we will take your request in consideration.

are there any reason you call those tests a unit? an't they integration by the nature?

Not exactly sure what you're asking. At the moment, I refer to an it block as a unit test. Currently, our organization prefers to write unit tests wherein a server can be spun up, then destroyed for a block of unit tests so that many blocks of unit tests can run in parallel at the same time without collisions.

from aws-utils.

cbaron avatar cbaron commented on July 30, 2024

@SET001

@cbaron is it possible to run local dynamo server and use it for each subsequent tests runs, instead of rerun dymano emulator each time?

My mistake, you'll notice here that the same dynamo server is used across all test runs.

from aws-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.