Skip to content

Instantly share code, notes, and snippets.

@mwillerich
Created November 23, 2015 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwillerich/efb9fed51d0430045b31 to your computer and use it in GitHub Desktop.
Save mwillerich/efb9fed51d0430045b31 to your computer and use it in GitHub Desktop.
testing TA-828
Testing broadcast:
1. get 2 dev or qa instances under your control, and check out the relevant branch on both machines
2. note down the instances' hostnames or IPs
3. on one of the instances, do this (all commands without the quotes): `rm /mnt/data/www/checkout/shared/config/tokens/* && rm /mnt/data/www/checkout/shared/cache/first-boot`
4. wait for 30 seconds or so, then run `restart checkout`
5. call this (on one of the instances) to create a file "instance-1.txt", which will hold all translations for that instance: `curl http://{instance-hostname or ip}:8000/api/tokens | python -mjson.tool > instance-1.txt`
6. call this on the same instance to create a file "instance-2.txt", which will hold all translations for that instance: `curl http://{other-instance-hostname or ip}:8000/api/tokens | python -mjson.tool > instance-2.txt`
7. both SHOULD create a file that has some text (with curly braces and such) in it
8. run `diff instance-1.txt instance-2.txt | grep ">" | wc -l`
9. you SHOULD get a number as a result that's bigger than 0.
10. run `curl -v -X POST -d '{"Type":"tokens","Action":"reload"}' ​-H "Content-Type: application/json"​ http://{instance-hostname or ip}:8000/api/notifications/broadcast`
11. wait for a minute or so (test fails if you wait longer than 2 minutes for the desired result)
12. repeat the calls from step 5,6 and 8
13. you SHOULD get a 0 as result
Testing individual instance cache invalidation
1. after the first test, make a small text change (add/remove a ., for example) in /my/checkout/registration in production Magnolia and publish it.
2. run `curl -v -X POST -d '{"Type":"tokens","Action":"reload"}' ​-H "Content-Type: application/json"​ http://{instance-hostname or ip}:8000/api/notifications`
3. repeat the calls from step 5,6 and 8
4. you SHOULD get a number as a result that's bigger than 0.
@mwillerich
Copy link
Author

Repeat test after initial fail (and subsequent fix) on broadcast cache invalidation:

      1. log shows all brands/locales/pages were reloaded, then web app was restarted
  1. done
  2. done
  3. PASSED
      1. it's actually the same, so I made it different. I removed a space in one of the token files, restarted the web app, re-ran 5 and 6 and now the result is 1.
  4. exact command called: curl -v -X POST -H "Content-Type: application/json" -d '{"Type":"tokens","Action":"reload"}' http://tokens-dev.co.photobox.com:8000/api/notifications/broadcast
      1. PASSED

Testing individual instance cache invalidation

  1. after finding out that local changes are taken into account, the change was done locally
  2. exact command called: curl -v -X POST -H "Content-Type: application/json" -d '{"Type":"tokens","Action":"reload"}' http://matthias-dev.co.photobox.com:8000/api/notifications
      1. diff instance-1.txt instance-2.txt | grep ">" | wc -l

89481

PASSED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment