Git Product home page Git Product logo

Comments (14)

ylt avatar ylt commented on August 17, 2024 1

Interesting, I'll have a look into this. This should be resolved as part of the shared-behaviours in point 5 though :)

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

@ylt note that I've expanded the above with some additional ideas, and also to include booking more than one event. To make this work within the existing framework, how about:

Within the templates could we repeat the OrderItems within the OrderItems (e.g. see below)? Then pass these through all the way from e.g. an array specified here?

For example

  "orderedItem": [
{{#each orderItem}}
    {
      "@type": "OrderItem",
      "position": {{& position}},
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "{{& offerId}}"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "{{& opportunityId}}"
      }
    }
  {{/each}}
  ],

I've also added to getRandomEvent notes in the example above

What do you think?

from openactive-test-suite.

ylt avatar ylt commented on August 17, 2024

Using an approach like this should be much easier than using Mustache: #37

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

Great plan!

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

@ylt just to note that C1 validation doesn't seem to be running in the master branch

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

Sure no rush if more efficient to do as part of point 5 :)

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

Include validation on the output of C1 with the correct validation mode (and if status code is not 200 then use "OpenBookingError" validation mode)

Although we did say that validation would be included in flow.C1() - so assume that it should in fact be part of that?

from openactive-test-suite.

ylt avatar ylt commented on August 17, 2024

Seems to be running fine in #38 openactive-integration-tests (zsh) 2020-02-27 13-22-17 :)

from openactive-test-suite.

ylt avatar ylt commented on August 17, 2024

That error handling is implemented in #36


Didn't quite include it into flow.C1(), but have wrapped it up into it's own helper. Logic itself needs to be running outside of a block.

from openactive-test-suite.

ylt avatar ylt commented on August 17, 2024

Actually finding much of these fairly complicated to implement. The flow component is only designed to deal with singular bits of info and it's hard to figure out how to adapt it to work with multiple in a nice way.

I'm thinking that the best way of defining this may be to come up with some test cases that would require these, then see how a solution naturally evolves as it's being developed.

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

@ylt funny I was just about to post in here...

C1 is still not validating in master

And if you try pointing it at https://everyoneactivebookingfacade-test.azurewebsites.net/, then many of the endpoints don't validate

Perhaps there's some kind of race condition or similar happening here?

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

note you'll need to turn random on to use the endpoint above

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

So I was using this to test an implementation tonight, but the tests were getting in the way so ended up moving this issue forward for you - hope this is helpful!

So now I've got the random opportunity part of this working at a basic level (single OrderItem), in commit ec96f67. See test/flows/book-only/ for my attempt at this.

This is the specific file: ec96f67#diff-121446740cc34c991fa12b7383997ee6

I think I've also might have identified the cause of one of the "race conditions". It looks like the flows are lacking some defensive programming for cases where a prerequisite call fails - specifically those calls that hit the microservice and wait for the feed - getMatch and getOrder. I've made a quick fix for getMatch, but we need something similar for getOrder.

It's also probably worth stopping all the main calls C1, C2, B etc executing if the opportunity couldn't be retrieved from the feed for some reason, as it'll just hit the booking system with loads of broken requests otherwise after the timeout (which may cause more race conditions). I've tried to do this here but haven't quite managed it: ec96f67#diff-7ec38b867eb5885e1977c92e06a66053

If you run npm test -- test/flows/book-only/ against the reference implementation on master now you'll see the issues for C1 validation - it's still not running. Very strange!

from openactive-test-suite.

nickevansuk avatar nickevansuk commented on August 17, 2024

Note this issue covered multiple features so has been split and closed: #40, #41, #41, #42, #43

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.