TeamCity create arbitrary directory structure on agent

526 views Asked by At

TeamCity on Windows Server + Agents

My integration-tests expect a certain directory-structure to be present, for example :

c:\foo\bar

TeamCity runs integration-tests on the agent. Therefore prior to running the tests, I need to ensure this is present on the agent.

Can this be accomplished via TC build configs ? Or do I need to write a script ?

2

There are 2 answers

3
Krzysztof Wolny On

It is possible (as it was stated in previous answer) but I'd say it's not a good approach.

Why expect a directory structure and not to create it by test itself in case it's not present? In this case nobody has to care about this structure, you can change it internally and noone needs to adjust settings.

It should be rather easy to create a structure in e.g. @BeforeClass annotated method. And it can be dropped once tests are done.

0
Biswajit_86 On

Ideally you checkout code from a vcs(Git,svn) into teamcity . In case you are using VCS checkout , you can checkout code to a custom directory on the agent

In case you don't have a VCS checkout, you can add a script to create the directory structure you need as the first build step