Git Product home page Git Product logo

Comments (5)

ylt avatar ylt commented on August 17, 2024

This is a global setting.

There is currently a useRandomOpportunities setting, this however only prevents deleting events rather than determining which tests to run.

Work needs doing to make this option used to determine which test suites need running.

from openactive-test-suite.

henryaddison avatar henryaddison commented on August 17, 2024

@nickevansuk Do we need a both option for this or just random and just controlled options?

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

Suggest one or the other

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

Additionally suggest a further improvement for the "controlled" version: just pass the case name to the "createOpportunity" test harness endpoint, instead of the full OpenActive model for the event (so just the name rather than the event from here).

This means they'd just need to create a switch statement inside the test endpoint to create the relevant type of event in the relevant state, instead of building a parser for an event in the OpenActive opportunity model, which they don't need anywhere else.

Especially as most elements of the parser would only be used once per test (as each test covers different properties), and otherwise the parser itself would need testing.

This should also mean that the "case" interface on the microservice can be identical to the "createOpportunity" test harness endpoint - passing both an opportunity type and a case name in both cases, and returning the ID of an opportunity in both cases. So the test harness endpoint will be modelled off this endpoint with an extra name query parameter - which should make it easy to use either the "random" microservice or the "controlled" test harness endpoints depending on the mode, as they will work identically.

This also means that we wouldn't need to separate "random" and "controlled" tests, as both could run in either case - which should simplify the design overall.

We can ensure that the .NET deployment does this in advance of the work.

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

useRandomOpportunities config setting achieves this by utilising the standard test interface.

Only allows running controlled or random, not both, for simplicity. Both can be achieved by simply running the test suite twice, as per:

# Run tests in random mode
echo 'Emptying output directory...'
rm -rf ./packages/openactive-integration-tests/output/
echo 'Running integration tests with useRandomOpportunities: true...'
NODE_CONFIG='{"useRandomOpportunities": true}' npm test --prefix packages/openactive-integration-tests --runInBand -- test/features/
echo 'Copying output files...'
cp -R ./packages/openactive-integration-tests/output/* ./publish/random/
# Run tests using booking system Test Interface
echo 'Emptying output directory...'
rm -rf ./packages/openactive-integration-tests/output/
echo 'Running integration tests with useRandomOpportunities: false...'
NODE_CONFIG='{"useRandomOpportunities": false}' npm test --prefix packages/openactive-integration-tests --runInBand -- test/features/
echo 'Copying output files...'
cp -R ./packages/openactive-integration-tests/output/* ./publish/controlled/

from openactive-test-suite.

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.