Recently we tried to include code analyzing tool in our Java builds - FindBugs.
But for some reason, after teamcity build finished and FB xml files parsed there is no Code Inspection tab on build page.
There is no errors in logs and i can't find a way to make this tab appear in a forced manner.
Apparently, Code Inspection tab appeared after TeamCity reboot and checking FB in bugged targets. So, tab may not be visible if there is no bugs (and sometimes you need to restart TC).
Related
Using eclipse to build a java project, I hit the Build Project button, there is no discerneable feedback/output whatsoever?
How can I tell that a build, happend and succeeded?
I have looked that in the filesystem the Project directory has indeed a /bin directories with compiled *.class files, so I now that something was build, but I look for a way to have eclipse give me that information.
How to configure eclipse to give output (i.e. to the console, status bar, if necessary message popupbox) about that some building happend.
As such you should get a popup window (shown in my last screenshot) showing the progress of your build, but in case if you are not getting then you can follow below steps to get "Progress" view of the Eclipse which shows progress of everything in the Eclipse.
And then build the project:
And you should get the progress information
As an aside: how to identify if Eclipse project has error? - If you project has build errors (it could be Java build problems, or JS or XML issues) then in the "Project Explorer" you will see a cross-mark-inside-red-square against that project, see a sample below:
Update: Another possibility to double check - make sure you are not running progress bars in the background, to verify that go to Window --> Preferences --> General and make sure "Always run in background" is NOT checked.
Further reading: this
I have installed the latest sonarLint plugins with Intellij 2016.1.2.
Analyze on the fly works fine. However, I can't find in the IntelliJ "Analyze" tab any "Analyze with SonarLint". In the SonarLint window>issues tab, I can only see scope "current file" or "opened files". I don't see any Project scope.
So my question is how to trigger the analysis on my whole project ?
Since SonarLint v2.8, it's possible to analyze all files in the project.
Open the SonarLint Tool Window, go to the Project files tab, and click in the "play" button.
There is also an action to which you can assign a shortcut.
More information here: https://www.sonarlint.org/intellij/howto.html
The easiest two ways to do project analyze:
Choose Analyze | Analyze with SonarLint
Press Ctrl + Shift + S
As #Duarte - SonarSource Team suggests Sonar-Lint has a different purpose. It is intended to use to analyze for code changes in current file(s). i.e. it cannot perform analysis which needs to compare 2 files. (ex: finding duplicates, coverage etc.)
For your purpose that best way to achieve is running SonarQube with preview mode.
Update:
As per this, the preview mode has been deprocated in v 6.6 and will be dropped in future.
they stated many times that their intent is to support only new issue being introduced running an on-fly analysis on files being changed.
If you wanna run a full analysis you should use the SonarQubeCommunity plugin or visit your remote Sonar Server.
If you wanna gather only coverage information within your IDE, use the Jacoco plugin.
However there is an open feature request to browse those issues directly in the SonarLint plugin: https://jira.sonarsource.com/browse/SLE-54
Yes, that screenshot is confusing, but that feature was previously available.
Since version 2.8 analysis of all files in the project is possible.
I'm using IntelliJ IDEA 15.0.2 (Community Edition) under Windows 7 and Windows 10 Pro, Gradle 2.9, JDK 1.7.0_65. Operating systems installed as guests under VMware Workstation 11.1.3
I have created Android Gradle application with single empty activity and wanted to check how unit test support works. There is a single unit test module ApplicationTest.java created by IDE, it contains only constructor. Right-clicking on [java] folder I created 'All in Module' JUnit3 test configuration.
Tests complete successfully when I Run them, however fail if I Debug the configuration. Failure reason says 'Terminated' (screenshot, IDEA log) which explained in the documentation as 'Test terminated. This status is assigned to tests that were cancelled by clicking the Stop button'. Just want to confirm that I didn't click the Stop button.
Logcat logs don't report any failures, IDE log reports 2 tests passed too. However problem remains as IntelliJ still reports a termination.
Sometimes I also getting 'Test framework quit unexpectedly' error and no tests succeed.
I've done some research and found similar questions, no real solutions mentioned. Have strong suspicion that this is a configuration issue.
What do I do wrong?
Gabor's suggestion seemed to fix this issue for me. On a Mac (and I presume on a Windows machine, but with a different route to get there) go to Preferences:
From the menu bar at the top Android Studio → Preferences
or
Hit ⌘ and , to jump straight to it.
Then in the menu search box type "instant". Uncheck the box that says "Enable instant run..", which looks like the image below.
That fixed it for me; didn't even need to restart/kill ADB.
It seems to be enabled by default, and I use it often to hot-swap changes during development, so I didn't think to turn it off when running Espresso tests.
In my situation, the problem is solved by setting in the test's run configuration:
Shorten command line -> JAR manifest.
To get rid of unit test problems in debug mode, I deleted all test folders in android studio explorer, then I commented three test implementation lines in build.gradle(module) file. Then I changed the combobox in android studio menu (top of the IDE) from "all in app" to "app".
https://i.stack.imgur.com/alPrS.png
In our case the fix (that may not be required in newer Android-versions) was to:
Open Edit Configuration... for All tests (or what ever you renamed it into).
Switch to Debugger tab.
And finally, in Debug mode combo-box, select the Java option, because:
Although we have lots of Native codes,
Android-studio 3.2.1 (which we were using) does not seem to support debugging both (but Java only mode works fine).
I'm looking for an IntelliJ IDEA plugin that would run my tests each time I change my code. I looked for such a solution and I found:
Infinitest, which works, but is inconvenient because I need to add the facet to each module, and it opens a new tool window for each module (which means 15 tool windows for me).
Fireworks - didn't work for me, maybe it just doesn't work with IDEA 14 (in its repo I can see that last changes were made in 2009). IntelliJ also reports that it throws exceptions.
There are lots of ways I could run all my tests (including writing a simple script for this), but I'm looking for a tool that would be smart enough to rerun failed tests first, and that would understand module dependencies (so after a change in some module it would run only tests of dependent modules).
I prefer free options, but if there's something paid for a reasonable price, I would accept it as well.
IntelliJ now actually has a Toggle auto-testin the run dialog. Just run a run-configuration and then select Toggle auto-testin the run dialog.
It's not as intelligent as you would have hoped. It just reruns when it detects changes.
I know this is a 3-year-old question but I think it will help people who face the similar problem in future. So I found out a way to enable SBT style auto test execution in IntelliJ studio.
We need to do 2 things to enable auto test execution.
Enabling auto project build - This can be done in settings by going into File -> Settings -> Build, Execution... -> Compiler and selecting "Build Project automatically".
Enabling "Toggle auto-test" in run dialog box
This will start auto testing. Although this works fine, it takes time to build the project even when my project is tiny so for larger projects it will certainly take very long time to complete the build and execute tests.
Reference: Original article which explains these steps
If you are OK running tests which cover a single method chosen by you, you can try this plugin (it is continuos in the sense that you make changes to a method, then click on the method and the plugin will run all the unit tests automatically which cover that method): https://plugins.jetbrains.com/plugin/15063-unit-test-coverage-history-runner
You can use the Intellij Teamcity plugin. Teamcity is a paid product but there is a free version which gives you 20 projects and 3 agents for free .
It has a remote run feature using which you can send in unchecked code to run tests before committing.
It also has options to run failed tests first
Usage instructions for Remote Run
When I run an Ant build, MyEclipse (happens for v6.0 and 7.5) formats my code. When I open the file it says it was modified on the file system and when I reload it it is formatted.
The thing that is even stranger is that it is not formatted as specified in the Code Style in my Preferences (seems like Java Sun codding rules).
As far as I could determine, there is nothing called by the Ant build to do the formatting so it MyEclipse doing it? Could it be a plugin or something?
Part of the build also includes Maven tasks so could there be a Maven plugin doing this?
I mention that I searched and deactivated all possible options in the preferences of the IDE trying to find some setting but nothing.
It is very annoying so far and could cause problems since I am working on some older projects with minimal modifications in the code and don't want to have a complete messed up version of a class just because I modified a word or something.
Has someone else encountered this?
P.S. It happens only on my PC. My colleagues don't encounter this issue.
Thank you!
EDIT: I have executed some tests:
I executed the Ant script outside of
eclipse (in command prompt) then
opened the files with notepad. The
files are untouched, no formatting
occurred. If I open eclipse nothing
happens to the files.
I opened eclipse and changed the files on the disk using notepad (added some spaces and saved them). Eclipse says the files are changed on the file system and asks to reload them. I say Yes he opens the files. The files are unchanged. No formatting occurs.
I run Ant from eclipse. Eclipse says files have changed and asks to reload them. I say Yes and when the files are opened they are formatted. WTF??!?!!
Is there a config that says to run some tasks after ant builds or something? I could not find anything.
Did you check the "Save actions"?
Preferences" menu, Java > Editor > Save actions.
One of the possible actions is to format your code when you save. You can have these preferences on a global or per project context.
Although it's strange that the code gets changed when you run your Ant script.
Eclipse can format on save if you choose, and you can elect to have it save automatically any modified files before a build. There is nothing in myeclipse that would cause the code to be formatted on load. I would look through your plugins.
Jalopy has an ANT plugin that will format code