-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate simulating GraphQL responses for testing #77
Comments
There is a complication, as most of the existing tools were used by traditional web applications, where a user would send a request to Service#1, then get the response, call Service#2, and so on. In our case, we have one endpoint only ( Which means we would have to find a tool that records multiple interactions. Most of the tools I've seen so far overwrite or raise an error when the same requests appears more than once. |
The best JS options were:
So will probably check the Python alternatives instead. We could use it to record the requests, and import into this |
It might be a lot simpler (if less elegant) to hack the workflow service and do a JSON dump (to file) of the suite data structure, then manually massage that into the new GraphQL schema? That would be easy for a small test suite at least. It might be painful for the 1000+ task complex demo suite. But we can start small! |
For Python the most famous is vcrpy. Even the deprecated uber/cassette now recommends users to use it too. |
That's an alternative too. We have already some methods in Cylc 8 branch of @dwsutherland that convert data from the pools and other objects into Protobuf messages, that are used to produce the GraphQL output... so that could be simpler indeed. It won't take long to verify if |
(sorry used cylc-7 above by mistake, already edited that comment) |
Tried the following tools:
|
In the end vcrpy was the best solution. But we have to use a custom url matcher with some interval, otherwise it matches the URL Quick code at https://github.com/kinow/cylc-cassettes, and the example GraphQL response from the workflow Now the idea is to write a quick JS code within The current task must be simply the index in a circular buffer... starting at 0, and going until the last tape/cassette found for This way, we should be able to quickly simulate workflows states without the need to run |
We started with the Suite Graph View issue (#74) but then we had a meeting, and after that others joined the discussion and now we have another broader issue for all Suite Views (#75), and it was also mentioned that it would be important to work on the testing part.
One part of the testing required is some simulated data, to be used by many tests to simulate possible states of a workflow, and pass through our code to verify its behaviour.
In #74, I was going to exactly work on the looking if a VCR-like tool could be used to record-persist-replay the requests of real workflows. And then use this persisted data for tests.
Now with the #75, I think it might be easier to work on this new issue, instead of documenting this part of testing in #74.
The text was updated successfully, but these errors were encountered: