Difference Between Quality Analyst and Developer
Developers tend to make sure the code does what it is supposed to do; QAs tend to make sure code DOESN'T do what it's NOT supposed to do. -- Darrell Grainger
I still use this quote today.
.
A technical blog about QA & testing
To search for specific articles you can use advanced Google features. Go to www.google.com and enter "site:darrellgrainger.blogspot.com" before your search terms, e.g. site:darrellgrainger.blogspot.com CSS selectors will search for "CSS selectors" but only on my site. |
Developers tend to make sure the code does what it is supposed to do; QAs tend to make sure code DOESN'T do what it's NOT supposed to do. -- Darrell Grainger
I still use this quote today.
.
First, sorry for not being around much. I've been lucky enough to be busy with work.
We had all the unit tests passing, smoke and integration tests passing but when we put the full enterprise environment to the test things which were failing.
The technology we are using can't be run locally. So stepping through the code and debugging the issue wasn't possible. We had to go old school and add print statements to the code to see what was happening.
First, you should be using something like log4j to control the log levels. This way you can add debug statements to the code but be able to turn them off when you deploy to a production environment.
But how do you determine how much is enough log statements? How do you determine what is too little?
I looked at our build. The end to end tests were passing on Monday. They only run nightly. In the course of the day there were 11 commits to the git repository. First, was the end to end test failing because of a commit in the code? Or was there a change in the enterprise environment?
My first step was to deploy the code from the last time it was working.
Fortunately, most build pipelines will let you build and deploy based on the git commit hash. So I looked up the last time the build was working for the end to end tests. The pipeline would tell me which git commit was used to build it.
So I run the pipeline and ask it to deploy that specific git commit. Then I run the current end to end tests on the deployed application. The end to end test passed. Now I have the git commit for when it was working.
I also have the git commit for the current master commit. This commit is failing today.
Let's say that the commit which was working was 0a803c1 and the latest commit was ea3dbb9. There are 11 commits. So how do I figure out what commit broke it?
I can see all the files which were changed using the git show command. The exact syntax is:
git show --pretty="" --name-only 0a803c1..ea3dbb9
This will provide a list of all the files which have changed. If a file was changed in different commits, multiple times, it will show the file more than once in the list. If all you care about is a short list of files which changed I'd actually use:
git show --pretty="" --name-only 0a903c1..ea3dbb9 | sort | uniq
This will get rid of duplication.
Once I know which files have been affected, I can start adding debug statements to these files and not bother focusing on any of the other files in the repository.
tmutil listlocalsnapshots /This will list the local snapshots on the root hard drive. From the output, you can then delete one or more of the local backups. I deleted all the local backups and found my hard drive went from 230 gigabytes used down to 117 gigabytes used. Essentially, the local backups were taking 113 gigabytes (almost half my hard drive).
tmutil deletelocalsnapshots <snapshot_date>where <snapshot_date> would be the date of the snapshot. Basically, the output of listlocalsnapshots would be:
com.apple.TimeMachine.<snapshot_date>where <snapshot_date> is something like 2018-01-14.
export XYZ_USERNAME='abssass'Now if I run the utility it will see these variable are set and use them to log in. Or I might have something like: "http://$XYZ_USERNAME:$XYZ_PASSWORD@hostname" and so long as the variables are set, it will automatically log me into the website.
export XYZ_USERNAME='2eD$g^^nJk5wHki6Lsst4Gwr'
vault read /secrets/team/storage/xyzThis might return something like:
Key Value xyz_username abssass xyz_password 2eD$g^^nJk5wHki6Lsst4Gwr
export XYZ_PASSWORD=$(vault read /secrets/team/storage/xyz | grep xyz_password | awk '{print $2}')export XYZ_USERNAME=$(vault read /secrets/team/storage/xyz | grep xyz_username | awk '{print $2}')