Teamcity build log prints one or several symbols per each line - teamcity

Teamcity build log prints one or several symbols per each line.
I get the following output while build is running:
It is quite hard to read such output. Is there any way to force Teamcity print log for the entire length of the lines?
UPDATE: Our team found out that build log was affected by maven-surfire-plugin which was added to pom.xml. As we don't need this plugin for our current needs it was enough to remove it for resolving the problem.

Related

Xcode 10, sourcery & swiftlint build phases order

After updating to Xcode 10 there are some issues with initial project configurations. The steps look like this:
Generating some files using Sourcery
Linting with SwiftLint
Build
And configuration works like this:
And this was working fine in Xcode 9, but apparently, it's not working under Xcode 10 build system. The issue is if I download repository (.generated files are not a part of the repository). And hit build it will show me results like:
...
Using configuration file at '.sourcery.yml'
Scanning sources...
Found 239 types.
Loading templates...
Loaded 9 templates.
Generating code...
Finished.
Processing time 0.491948962211609 seconds
...
So sourcery works ok, then linting:
Linting 'FromResponse.generated.swift' (1/186)
Works fine as well as a process, but in the end, build will fail with:
error: Build input files cannot be found:
'/path/Generated/FromResponse.generated.swift',
...
So it's strange since a files are physically there and according to build settings file should be compiled later than generating them. How should I approach sourcery in build process then?
We are able to "fix" this in a similar way as this Github issue:
https://github.com/mac-cain13/R.swift/issues/438#issuecomment-416982928
We have to add each of the generated files by Sourcery to the output folder and it will get picked up by the Xcode correctly.
This relates to changes in the New Xcode Build System that has been enabled by default in Xcode 10. If a build phase creates files which are needed as an input to a later build phase then it needs to specify them explicitly in the Output Files or Output File List.
In your example the Sourcery build phase is generating Swift source file(s) which are needed as input to the Compile Sources phase.
However, the issue at this point is that after you specify the output files for Sourcery, the build phase doesn't re-run every time as it sees the output file is already there. So far I haven't worked out a useable solution to this part, beyond running tools like Sourcery and SwiftGen manually or keeping the generated files in Git so that they are always present.
I was having a similar problem with a buildphase calling mogenerator to build my data model classes. The approach given by #Yuchen should work.
#Andrew: To force always (re-)running this build phase, I add the line
touch .alwaysRun
as the last line in the shell command to run and mark the build phase "Input Files" to have $(SRCROOT)/.alwaysRun. That seems to do the trick.

Is it possible to TeamCity Build Log file and mail it

I am working on TeamCity,
There are lot of failures in the my TestCase Automation,
I want to get the Build.log file,
I dont know the location of Build.log.
can some one please tell me where is this file location in Build Agent.
To get the build log you'll need its build id and place it into the following URL:
http://teamcity:8111/httpAuth/downloadBuildLog.html?buildId=BUILD_ID
It is also possible to get the build log as the zip file using
http://teamcity:8111/httpAuth/downloadBuildLog.html?buildId=BUILD_ID&archived=true
Just replace BUILD_ID with the desired build id.
For the detailed info, you may refer to the documentation

How can I track deprecation warning counts in teamcity builds?

I'd like to scan the build log at the end of each Teamcity build to count the number of deprecation warnings in the build. I don't want this to be a failure condition regardless of how many there are. I'd like to make this number a Teamcity statistic so that I can track it over time.
I'm pretty sure there are ways I could achieve this but they quickly become very hacky. I was hoping Teamcity would provide an option to build a statistic from running grep -c whatever over the build log but I can't find anything similar.
Is there an option for analyzing the build log to collect Teamcity build statistics?
I don't believe there is. You can create a TeamCity plugin to do what you need.
My solution was to add a build step that counts deprecation warinings in the app's log (not the Teamcity build log) and print a teamcity formatted message.
grep -c "DEPRECATION" %system.teamcity.build.checkoutDir%/log/app.log | xargs -I{} echo "##teamcity[buildStatisticValue key='deprecationCount' value='{}']"

TeamCity pass codebase changes to next build

I have a TeamCity build that sometimes fails too early.
What I mean by that is that the first few steps are for "provisioning" (setting up the testing environment) and the testing of my code itself comes later.
Sometimes (for whatever reason) the build fails during one of the "provisioning" steps. This is not a problem since running the build again usually works fine.
But - the "changes" are not passed along to the next run of the build.
I am using this command as part of my build to output the "changes" that came from my codebase:
copy "%system.teamcity.build.changedFiles.file%" changelog.txt
So I need a way to tell TeamCity "hey, ignore the last run, that failure doesn't count because it didn't test my code, I want the next run to contain the same 'changes' in system.teamcity.build.changedFiles.file"
How can I do that?
Have you tried build chains with dependencies? They can be set up to only execute if the build (including tests) is successful: http://blog.jetbrains.com/teamcity/2012/04/teamcity-build-dependencies-2/

Change build label for Project Cruisecontrol.net

After some unexpected changes on the Cruisecontrol.net buildserver the artifacts directories were gone, and the build labels were reset on all projects. How can I change the build label value on the projects? We are using CCNetLabel variable in our scripts.
I tried updating the .state file with no success. it just overwrites the values on the next build. Also tried manipulating the latest log file in the artifact directory
You can use the <initialBuildLabel> value to set it in your .config file. This documentation for the Default Labeler gives more detail, but here is their example:
<labeller type="defaultlabeller">
<initialBuildLabel>1</initialBuildLabel>
<prefix>Foo-1-</prefix>
<incrementOnFailure>true</incrementOnFailure>
<labelFormat>00000</labelFormat>
</labeller>
I think this is what I did in my build config when I needed to do this, but have since removed it once it got going at the number I wanted.

Resources