Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do remote agents execute tasks?

I have a Python project for which I run pytest using tox.

When I run tox manually on the agent (from the same directory from where the task runs) everything works, but when running with the remote agent I am getting some issues with the environment variables already set by tox. Tox creates a virtual environment, set variables there and then executes pytest. Somehow, this is not working when executed from Bamboo.

This is a problem because we expect to run unit tests in bamboo in the same way as we run them locally.

How does a remote agent execute the tasks? Is the agent setting some virtual environment? Clearly is not running a task in the same way as in the script section. What are the differences?

We are thinking about moving all our automation from TeamCity to Bamboo (given that we use Bitbacket, JIRA and Confluence already), but it's not a good shift if Bamboo doesn't behave as expected (we expect a script to behave the same as if run manually from the command line).

2 answers

1 accepted

0 votes
Answer accepted

The problem was solved by restarting the remote agent. Does the agent need to be restarted each time you install something in the box?

In particular, the installation was setting the global PATH variable, and this was not reflected within the agent until restarting.

Processes that are already running don't see the changes to environment variables made after they were started. 

Maybe your agent is running as different user? And picking up a different set of env variables?

The variables are set on the tox.ini file that runs on the Script. Tox doesn't depend on any environment variable set. But looks like bamboo in interfering on that. Tox works on any machine independently of the environment variables, that's why my concern about how the agent actually run the tasks.

Additionally, the agent is running with the same user and location for which the manual execution of tox works.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center 8.1 is now available

G’day Bamboo customers, Bamboo DC 8.1 is now available with it the following features and programs: SAML 2.0, OpenID Connect, and Crowd SSO In order to help admins with a simplified user manage...

167 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you