Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

How to configure a script for a task to run a Python project?

Please do not direct me to Atlassian Documentation because the documentation is useless.

I'm trying to automate Python testing in Bamboo for a project. The project has dependencies to e.g. Anacondas modules (pandas, numpy etc.). I don't have the faintest idea how Bamboo works and how scripts are supposed to be written. I would very much appreciate simple instructions on how to set things up. For example:
1) Create a virtual environment by doing this...
2) Add venv python to PATH like so...
3) Run your tests as such...
4) Collect test results in a file like so..
5) Report your test results by doing this..

 

 

Below is what I have tried (by guessing and testing):

 

I have set up the Source Code Checkout which works correctly.

I have included a virtual environment in the repository and I am able to activate it with the commands:
WD=/${bamboo.build.working.directory}/
source "$WD"//env//Scripts//activate

I have a python.exe located in:
"$WD"//env//Scripts/python

If I try to run:
"$WD"//env//Scripts/python "$WD"/test_library/my_test.py
I get the following error:
//app/atlassian/bamboo-agent/current/xml-data/build-dir/XXXXX///env//Scripts/python
"No such file or directory"

 

If I instead do this simple test it works correctly:


/usr/bin/python <<EOF
print "Hello, World!"
EOF

Thank you in advance!

1 answer

1 vote
Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 25, 2018 • edited

I have a python.exe located in:

Do you mean python executable file for Unix?

//app/atlassian/bamboo-agent/current/xml-data/build-dir/XXXXX///env//Scripts/python

Access the remote agent machine and confirm if the file /app/atlassian/bamboo-agent/current/xml-data/build-dir/XXXXX/env/Scripts/python exist.

If yes, try running the following command manually through Terminal in the machine hosting the agent:

/app/atlassian/bamboo-agent/current/xml-data/build-dir/XXXXX/env/Scripts/python /app/atlassian/bamboo-agent/current/xml-data/build-dir/XXXXX/test_library/my_test.py 

 

This doesn't answer the question. Bamboo does NOT provide a way to install packages or languages. For example, I need to install python on a Bamboo docker image, but apt isn't available and neither is root. 

 

How can we conduct testing without the availability of languages or the ability to install packages. I agree with the post above. The documentation is unless.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events