Posts

Showing posts from 2019

How to debug phpunit ? How to ​force display logs of phpunit ?

Image
Introduction See how to concretely, force an output message during a phpunit execution fwrite(STDERR, "TEST"); Example of a use case in the code /** * testArtworkSetsAssignmentInfoValidProductUUIDAction * * @throws \GuzzleHttp\Exception\GuzzleException * * @author David Raleche * @version 08-26-2020 */ public function testArtworkSetsAssignmentInfoValidProductUUIDAction () { $payload = array ( "order_id" => "1234560" , "customer_id" => "12345" , "product_info" => [ "product_uuid" => "12345" ] ) ; $jsonPayload = json_encode( $payload ) ; $artwork_set_uuid = ArtworkToolService:: postArtworkSets ( $jsonPayload , 12345 ) ; /** ------------------------- GET ------------------------------------------------- */ $headers = [ 'Authorization' => QATemplate:: $getKey , ] ; $url = '/v1/artwork-info/&#

AWS SQS, DLQ, SNS (Slack), Lambda, Cloudwatch

Image
I am currently working on a transactional platform where orders are pushed to a Queue SQS then pulled and processed by lambda. In a problematic situation , lambda triggers AWS SNS which will notify sysOp via email and a Slack Channel. Awesome ! And more importantly a DLQ — Dead-Letter Queue will contain workers waiting to be reprocessed and sent to our Technical Customer Service Department to analyze what went wrong

New Relic - More visibility for my team members

Image
I am adding New relic for tracking our apps performance New Relic  is a web application performance service designed to work in a real time with your live web app.  New Relic  Infrastructure provides flexible, dynamic server monitoring. … It can be considered as the plumbing that makes web apps run faster.

PHPUnit (truncated...) - SOLUTION

If you experienced the difficult task to debug the  (truncated…)  error message through PhpUnit see below global solution ! The exception caught is related to the  guzzle version A try-catch around your phpunit test would get the GuzzleException $e Example $client = new GuzzleHttp\Client([‘base_uri’ => ‘ https://foo.com/api/ ']); try { $response = $client->request('GET','/v1/testYourEndpoint'); } catch (\GuzzleHttp\Exception\ClientErrorResponseException $e) { var_dump($e->getResponse()->getBody()->getContents()); } catch (\GuzzleHttp\Exception\RequestException $e) { var_dump($e->getResponse()->getBody()->getContents()); } catch (\GuzzleHttp\Exception\ClientException $e) { var_dump($e->getResponse()->getBody()->getContents()); } try { $response = $client -> request ( 'GET' , '/v1/testYourEndpoint' ); } catch ( \GuzzleHttp\Exception\ClientErrorResponseException $e ) {

Git Delete History - Git Delete Log

Image
Git Delete Log History #1  — Terminal Git Rebase #2  — from vi/vim do the following changes — replace ‘pick’ by ‘drop’ #3 — Commit Current Change git commit — allow-empty #4 —  Continue Rebase for cofirmation of what you want to see git rebase — continue #5 —  Command line — Push to your repository git push -f #6 — Final Screen ‘bbb’ removed

GIT HELPER - DAVID RALECHE

SYNC GIT git remote update git fetch  Downloads the latest from remote without trying to merge or rebase anything. git fetch -- all Rename Git Commit git commit -amend REMOVE untracked files git clean -f -d RESET BRANCH/FILE git reset --hard origin/master  -- force discard local changes git reset --hard origin/  -- force discard local changes git checkout -f  -- force discard local changes COMMIT git commit -m ‘My commit David Raleche’ remove git add git reset HEAD -file- PUSH git push origin CONFLICTED FILES git diff --name-only --diff-filter=U  GIT ADD  git add  git commit -m “message of your commit” git push origin GIT RESET ADD git reset   git reset (VERY DANGEROUS) REMOVING LAST COMMIT (VERY DANGEROUS) git reset --soft HEAD~1 git reset --hard HEAD^ (VERY DANGEROUS) GIT CHECKOUT SOMEONE ELSE REPO git checkout --track origin/ECOM-307