Skip to content
FacebookLinkedin
Scott Wilson's Software Testing BLOG
Scott Wilson's Software Testing BLOG
Double Duty Design for Mastering Test Automation
  • Home
  • Coming
    Soon
  • Fun4
    Kidz
  • Scott
    Wilson
  • Home
  • Coming
    Soon
  • Fun4
    Kidz
  • Scott
    Wilson

How to use Bash to rip thru your tasks – #1 of 5

Want create site? Find Free WordPress Themes and plugins.

The Bash Monster

I’m always doing the same thing. Different task. Same thing though.

Running tests. Checking results. Reading log files. Making fixes. Repeat.

Here’s what I do to save time, effort, money…..

============================================================

 

Type “1183” or what ever Jira task id I’m working on.

That sets up all the context for task 1183.

It automatically displays the relevant test suite and parses for all the test cases
/workspace3/src/FoobarProject/main
MY_SUITE = FoobarTests
public void test1() throws Exception {
public void test2() throws Exception {
public void test3() throws Exception {
Current test case: test2
MY_PARAMS = -a -b -c -d
MY_ACCOUNT = ScottsPowerUser
accountId = 1234

Environment = Test

============================================================

I want to display the results of previous tests. I don’t like the default logging so I created my own.
Type “listlogs”
(1) 1183.20170327:165809–20170327:235809.test.FoobarTests.test2.log
Description: try to repro issue
Assessment: Workflow took too long
[java] TotalTests:  [5]
[java] PassedTests: [4]
[java] FailedTests: [0]
[java] CancelledTests:   [1]
BUILD FAILED
Total time: 183 minutes 51 seconds

(2) 1183.20170330:113638–20170330:183638.test.FoobarTests.test2.log
Description: Fixed ABC, try to repro failure
Assessment: Looks good
[java] TotalTests:  [5]
[java] PassedTests: [5]
[java] FailedTests: [0]
[java] CancelledTests:   [0]
BUILD SUCCESSFUL
Total time: 114 minutes 7 seconds

============================================================

I’ve made another change and want to test before committing my work.

I’m too lazy to type a long complex command line to kick off my test so created another shortcut.

This just formulates the command so I can double check before running.

$echoruntest “run againsts test env with foobar parameter”
/workspace3/src/FoobarProject
cmd = nohup run-test -DcliArgs=”-env test -user ScottsPowerUser –test FoobarTests.test2 -a -b -c -d” > /home/scottwilson/1183.20170417:092128–20170417:162128.FoobarTests..test2.log 2>&1 &

Ok that looks good let’s run for real.
$runtest “run againsts test env with foobar parameter”

nohup run-test -DcliArgs=”-env test -user ScottsPowerUser –test FoobarTests.test2 -a -b -c -d” > /home/scottwilson/1183.20170417:092128–20170417:162128.FoobarTests..test2.log 2>&1 &

 

============================================================
I want to follow the progress. Sometimes I have a bunch of tests running at the same time.
$followlogs 10 30
iterations = 10
sleepIncr = 30

(1) 1183.20170327:165809.test.FoobarTests.test2.log

(2) 1183.20170330:113638.test.FoobarTests.test2.log

(3) 1183.20170401:093638.test.FoobarTests.test2.log <== new
sleepingr 30 seconds…………………………

 

iteration #9

(1) 1183.20170327:165809.test.FoobarTests.test2.log

(2) 1183.20170330:113638.test.FoobarTests.test2.log

(3) 1183.20170401:093638.test.FoobarTests.test2.log <== updating
============================================================
Sometimes I want to see what processes are running.

You can also copy & paste the kill command if you want to terminate the job.

myps
ps auxwww | grep FoobarTests | grep myCurrentTest

EF314DE99D6BA51BB8 –lang=en-US –extension-process –enable-offline-auto-reload –enable-offline-auto-reload-visible-only –blink-settings=disallowFetchForDocWrittenScriptsInMainFrame=false,disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections=true –enable-pinch –num-raster-threads=2 –enable-zero-copy –enable-gpu-memory-buffer-compositor-resources –enable-main-frame-before-activation –content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,34037;0,11,34037;0,12,34037;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,34037;1,11,34037;1,12,34037;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,34037;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,34037;2,13,3553;2,14,34037;2,15,34037;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,34037;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,34037;3,13,3553;3,14,34037;3,15,34037 –disable-accelerated-video-decode –disable-webrtc-hw-vp8-encoding –service-request-channel-token=C324011AF3D99DEF314DE99D6BA51BB8 –renderer-client-id=1589
Num processes: 2
kill -9 21246
kill -9 21455

 

============================================================

I’ve been using tricks like this for years to save time, effort, money.

If you’d like to learn how to do this reach out to me on social media.

 

Did you find apk for android? You can find new Free Android Games and apps.
Category: bash, Mentoring, Software TestingBy hockeyehApril 14, 2017Leave a comment
Share this post
Share with FacebookShare with TwitterShare with Google+Share with PinterestShare with LinkedIn

Post navigation

PreviousPrevious post:How to Read Log Files Quicker – #1 of 4NextNext post:QATools – #1 of 10 – my open source project

Related Posts

Scott Wilson’s mentoring service
May 21, 2017
The Serendipitous Bug Finder – Finding Bugs You Aren’t Specifically Testing For
May 3, 2017
Bash scripting – How to Make the Best Use of Your Time – #2 of 5
May 2, 2017
QATools – #2 of 10 – Bond, James Bond
April 28, 2017
How to Read Log Files Quicker – #2 of 4
April 27, 2017
Scott Wilson
Do you have any questions for me?
What are your top 5 goals, listed in priority order?
What are your top 5 pain points, listed most painful to least painful?

April 25, 2017

Leave a Reply Cancel reply

You must be logged in to post a comment.

Copyright information © 2017 Scott Wilson Enterprises (swBlog.org). All Rights Reserved.