-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add testing for MapModule's proper construction #4717
Closed
Labels
bug
the issue is regarding one of our programs which faces problems when a certain task is executed
discussion
testing
issues are usually for adding unit tests, integration tests or any other tests for a feature
Comments
rexagod
added
bug
the issue is regarding one of our programs which faces problems when a certain task is executed
testing
issues are usually for adding unit tests, integration tests or any other tests for a feature
discussion
labels
Jan 28, 2019
Hi @rexagod !
The error in #4714 was due to script not being loaded .
See this comment here (i changed the code where we were loading script earlier) :
What do you think ? Would you like to work with me on this one ? |
Ah yes actually I like the idea of testing if the API exists before loading
it, that'd have stopped this bug from cascading to other issues. Great idea!
I wonder though if the test @rexagod proposes would catch issues like
yesterday's, where the issue was in the deployment setup? Maybe still
worthwhile but let's try to imagine exactly what scenarios it'd catch!
…On Tue, Jan 29, 2019, 8:02 AM Sagarpreet Chadha ***@***.*** wrote:
Hi @rexagod <https://github.com/rexagod> !
panMapToGeocodedLocation this function of LBL uses Google API .
The error in #4714 <#4714> was
due to script not being loaded .
- I guess we can write a test to confirm that the script is being
loaded or not before the actual loading of the page content , that would
make us more confident that this will not happen again
See this comment here (i changed the code where we were loading script
earlier) :
#4608 (comment)
<#4608 (comment)>
- Also , in LBL if we can write some if condition in the
panMapToGeocodedLocation function when it uses the google API's
function --- to check if that function exists or not !
What do you think ? Would you like to work with me on this one ?
Thanks 😄 !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4717 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ5wZxa8YCk5eZwewymFFJMLMMh_aks5vICpCgaJpZM4aW2Vc>
.
|
Okay it seems there may be two possible approaches here.
|
So i like the first approach mainly because it allows us to stop the error
from cascading and disrupting other functionality on the site, which i
think is good practice -- it's pragmatic and quick to implement with only 1
line of code.
For the second, I think the issue may still be that this won't come up in
tests to be caught at all, since it was an issue with deployment, not code
-- we could, perhaps, try to implement a system test (new feature in Rails
5.1+) to actually boot the whole site + javascript, and monitor for errors
on various pages that way, which would be interesting, although a bit
heavy: #3683
…On Thu, Jan 31, 2019 at 2:15 AM Pranshu Srivastava ***@***.***> wrote:
Okay it seems there may be two possible approaches here.
- Check if google is defined and execute this code only if it is. This
may not give expected results if we decide to include other google API's in
the future and one of those fails, throwing the same error.
- Since the above code was in the error stack when this happened, we
can search the Error.prototype.stack for the same.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4717 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJyqht0BZTePRR0IVt3CtYLBLto3Xks5vIpf9gaJpZM4aW2Vc>
.
|
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
the issue is regarding one of our programs which faces problems when a certain task is executed
discussion
testing
issues are usually for adding unit tests, integration tests or any other tests for a feature
Aims to identify issue #4714 if it happens again. I think we can check to see if the code below throws an error or not.
Reference - #4714 (comment)
The text was updated successfully, but these errors were encountered: