-
I want to use Saleor as a demo app for an OpenZiti + NVIDIA Morpheus demo so need to generate logs of normal traffic. Is there any way you can tell me which files to look in to make these adjustments so that I can programatically input random values for them in my Locust script? I just finished learning GraphQL and tried asking Cursor IDE with the entire code base of storefront as context but it's only giving me a partial answer. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
I'm more than willing to assist, but I must admit that I'm not entirely certain about the specifics of what you're looking for. Could you please provide more details or clarify your question? |
Beta Was this translation helpful? Give feedback.
-
That is because I was trying out your app, with the mock data loaded into Postgres (Saleor branded hoodies, beanies, shoes, etc), selected a few items and tried to check out but I actually needed a real credit card number, ie. could not input "1234 5678 9012 3456" as the validation would catch it. So in this instance, I would want validation to be disabled since when I run my Locust script, I am going to have a line in Python like
That lets me mock a user entering credit card info in the context of load testing the app. I asked in the chat window of Cursor IDE the following with the entire code base as context: "Look at the entire code base and tell me exactly what to refactor in which files so that the app wlll accept any value for: email used for registration, credit card info, first name, last name, password and any other fields you can think the app will ask for in order to regsiter and login. I want to be able to run Locust load test script on the app and want to just give these fields random values. " Basically I want to bypass or turn off all validation of user input so my Locust script is free to focus on load testing rather than providing valid inputs which is impossible for something like credit card numbers since my Locust swarm will have 10,000 or so "users". Cursor IDE chat window continued: To make the application accept any value for the fields you mentioned, you would need to modify the validation rules for these fields in the application's code. Here are the files and the changes you would need to make:
In the useGuestUserForm.ts file, the validation schema for the guest user form is defined. You would need to remove or modify the validation rules for the email, password, and createAccount fields.
In the LoginForm.tsx file, the form values for the login form are defined and used. You would need to remove or modify the validation rules for the email and password fields.
In the useErrorMessages.ts and errorMessages.ts files, the error messages for various validation errors are defined. You would need to modify these files to remove or change the error messages related to the fields you mentioned.
In the schema.graphql file, the GraphQL schema for the application is defined. You would need to modify this file to remove or change the validation rules for the fields you mentioned.
Please note that these changes could have significant impacts on the application's functionality and security. It's generally not recommended to remove or weaken validation rules, especially for fields like email and password, as this could make the application vulnerable to various types of attacks. Also, keep in mind that these changes would only affect the frontend validation. The backend server might also have its own validation rules for these fields, which you would need to modify separately. |
Beta Was this translation helpful? Give feedback.
-
I'm not 100 percent sure as for the accuracy of the info given to me b ChatGPT in Cursor IDE but it's a starting point. It also suggests I would need to perform edits in |
Beta Was this translation helpful? Give feedback.
-
I looked at Saleor Core and there is quite a bit of validatio logic in there, nested at times so can you advise on before I move forward tyring to disable it so I don't break it? I want the Docker container I'll make to work with Saleor Platform so version 3.17 is what I am looking to edit. @mmiszy At some point, you must have load tested it and had a version that would accept dummy data. |
Beta Was this translation helpful? Give feedback.
-
So you just want to disable address validation? |
Beta Was this translation helpful? Give feedback.
-
@mmiszy if possible, all of it so Locust can just run wild :) |
Beta Was this translation helpful? Give feedback.
But what would be the point of that?
Providing an invalid address makes it impossible to fetch and select a shipping method.
Some products may be limited to certain shipping locations.
And load testing with validation disabled will likely give you inaccurate results.