TeamCity: Acceptance Deployment Dependency Management?

I’m trying to set up a set of build configurations in TeamCity 6 and I’m trying to determine as precisely as possible the specific requirement that TeamCity can include.

I have a set of acceptance tests (about 4-8 sets of tests grouped by the functional area of ​​the system to which they belong) that I want to run in parallel (I will model them as assembly configurations so that they can be distributed across many agents).

From my initial research, it seems that with the meta-build configuration AcceptanceTests , which pulls Acceptance tests into a set of individual test configurations through Delays from the snapshot, should do the trick. Then all I have to do is say that my Commit build configuration should run AcceptanceTests and they will all be pulled in. So let's say I also have AcceptanceSuiteA , AcceptanceSuiteB and AcceptanceSuiteC

So far so good (I know that I could also rotate it in a different way and cause Commit config AcceptanceSuiteA , AcceptanceSuiteB and AcceptanceSuiteC to run - the problem is that I need to manually aggregate the results to determine the overall success of the acceptance tests in general) .

The complicating bit is that although AcceptanceSuiteC just needs some Commit artifacts and can then live on it, AcceptanceSuiteA and AcceptanceSuiteB need:

  • DeploySite (let's say it takes 2 minutes and I cannot afford to completely isolate just this run)
  • Run tests with deployed site

The problem is that I should be able to ensure that:

  • website is configured only once
  • The website is not reset while two sets work.

If I configured DeploySite as an assembly configuration and had AcceptanceSuiteA and AcceptanceSuiteB , pull it out as a snapshot dependency, AFAICT:

  • subsequent or parallel launch of AcceptanceSuiteB may initiate another DeploySite that will compress the deployment that AcceptanceSuiteA and / or AcceptanceSuiteB are in the middle of use.

While I can tell you to limit the number of assemblies running at the same time to make only one thing happen at a time, I need to have one at a time and until the dependency parts are still running.

Is there a way in TeamCity to model such a hierarchy?

EDIT: Ideas: -

The solution to crap is that DeploySite can set the “use flag” token, and then reset AcceptanceTests so that the flag [after AcceptanceSuiteA and AcceptanceSuiteB complete]. Then the problem becomes one of the next DeploySite queues down the pipeline until this shutter is opened again (Waiting for a lock inside the assembly does not seem correct - I want it to be marked as “not yet running”, but not like that it takes a long time to do something). However, this kind of flag is here and this bit checks that it is a kind of flaky / peeling odor that I am trying to escape from.

EDIT 2: if I could programmatically change the configuration of the agent, I could set Agent Requirements to require InUse = false, and then set a flag when deployment starts and clears after tests are run

+6
source share
1 answer

It seems you are looking at Jetbrains Devnet and YouTrack tracking first and remember to use the magic word clobber in your search.

Then you install groovy-plug and use the StartBuildPrecondition tool

To use this function, add system.locks.readLock. or system.locks.writeLock. property for assembly configuration. Builds using writeLock will only start when there are no builds started using read or write locks with the same name. Build with readLock will begin only when there are no builds launched with write lock with the same name.

to control the fact that the dependent read and DeploySite config configs write a common item.

(This is not a complete solution, so the tracker element remains open)

EDIT: And I still don't know if the lock should be under Build Parameters | System Properties and what is the exact format of the name, is it locks.writeLock.MYLOCKNAME (i.e. displayed in config with the reference syntax %system.locks.writeLock.MYLOCKNAME% )?

Other puzzles: how to control the removal of the assembly caused by the completion of the write access assembly writeLock - does the lock lock until the next record is received (which will allow another scenario) - or if something is necessary in turn depending from parent and child dependencies?

+3
source

Source: https://habr.com/ru/post/885646/


All Articles