Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,412
Community Members
 
Community Events
184
Community Groups

Quarantined tests for two build plans?

Is their a way to have quarantined tests for one build plan auto populated to another? We have essentially two Main build plans. One is used for offshore work that gets merged back to the primary daily.  At any given time we have 10-20 quarantined tests coming and going that we would like to be mimicked in the secondary project build plan without having to manually keep them in sync.

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 27, 2019

Hi @tdzarnes

Is their a way to have quarantined tests for one build plan auto populated to another?

Bamboo does not have an out-of-the-box feature for this.


We have essentially two Main build plans. One is used for offshore work that gets merged back to the primary daily. At any given time we have 10-20 quarantined tests coming and going that we would like to be mimicked in the secondary project build plan without having to manually keep them in sync.

I totally get your scenario, thank you for explaining it. I'll share what I have and hope that this allows you to move forward.
Bamboo has a rest API to add tests to quarantine, this is the one:

curl -u <USER>:<PASSWORD> \
-H 'Content-Type: application/json' -d{} \
-X POST http://<BAMBOO-URL>/rest/api/latest/plan/COM-TO/test/<TEST-CASE-ID>/quarantine

You will notice that you will need to get the <TEST-CASE-ID> for each one of the tests that you want to put in quarantine. There are two problems here:

  1. There is no REST endpoint to provide you with the <TEST-CASE-ID> at the moment due to this bug: https://jira.atlassian.com/browse/BAM-19816
  2. The test can be exactly the same in both plans but you will have different ids for them.

In order to workaround this I was able to build a query that will show the equivalence of each test considering the test class and test name in both plans.
This is the one:
⚠️It was designed for Postgres DB. In case your DB is different, please update it accordingly.

WITH 
        plan1_tests AS
        (SELECT *        
         FROM build b
         JOIN test_class tcl ON tcl.plan_id=b.build_id
         JOIN test_case tc   ON tc.test_class_id=tcl.test_class_id
         WHERE b.full_key like 'PROJ-PLAN1%'),

        plan2_tests AS
        (SELECT *
         FROM build b
         JOIN test_class tcl ON tcl.plan_id=b.build_id
         JOIN test_case tc   ON tc.test_class_id=tcl.test_class_id
         WHERE b.full_key like 'PROJ-PLAN2%')

SELECT p1.test_class_name,
       p1.test_case_name,
       p1.full_key AS p1_full_key,
       p1.test_case_id AS p1_test_case_id,
       CASE WHEN p1.quarantine_date IS NOT NULL THEN '---YES---' ELSE '---NO---' END AS p1_quarantined,
       p2.full_key AS p2_full_key,
       p2.test_case_id AS p2_test_case_id,
       CASE WHEN p2.quarantine_date IS NOT NULL THEN '---YES---' ELSE '---NO---' END AS p2_quarantined
FROM   plan1_tests p1
JOIN   plan2_tests p2 ON (p1.test_class_name=p2.test_class_name AND p1.test_case_name=p2.test_case_name)
WHERE  p1.quarantine_date IS NOT NULL OR p2.quarantine_date IS NOT NULL

The query should show you only the tests that are quarantined in any of those plans. It could be in the first one, the second one or both. With some programming skills, you should be able to make a script to get these details from the Bamboo DB and run a couple of REST APIs to adjust one plan based on the other one.

I hope it helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events