These are chat archives for sbt/sbt

8th
Jul 2016
vito-c
@vito-c
Jul 08 2016 04:58
does setting this in my build.sbt concurrentRestrictions in Global += Tags.limit(Tags.Test, 1600) actually do anything? i keep upping the value to see if my test time speeds up but nothing changes
vito-c
@vito-c
Jul 08 2016 05:56
anyone?
nafg
@nafg
Jul 08 2016 06:24
@vito-c where is that setting from?
I tried 200 400 800 1600
same results
nafg
@nafg
Jul 08 2016 07:24
@vito-c did you read that page?
The example limits:
  • the number of CPU-using tasks to be no more than 2
  • the number of tasks using the network to be no more than 10
  • test execution to only one test at a time across all projects
  • the total number of tasks to be less than or equal to 15
it has nothing to do with test speed
vito-c
@vito-c
Jul 08 2016 07:27
test execution... executing more tests at once should result in overall testing time to be faster
nafg
@nafg
Jul 08 2016 07:27
This message was deleted
@vito-c you have 1600 different test tasks? and you expect them to run simultaneously? how many cores does your cpu have?!
vito-c
@vito-c
Jul 08 2016 07:28
maybe I don't know what a test task is then
is a test task each test suite? each unit test?
@nafg ^
nafg
@nafg
Jul 08 2016 07:55
That depends on the framework, maybe an sbt subproject since further than that is probably the framework's jurisdiction
But even if it was a unit test, a computer can only do so many things at once. If tasks are CPU bound then the fastest is one per core
More than that is slower because it just means pointless context switching
If tasks wait asynchronously then you could do more
and still be faster
Lena Brüder
@lenalebt
Jul 08 2016 08:37
Hi together :). I am trying to introduce some hack to my global.sbt to create a unique version number for each deployment to my docker-registry. When deployed to the project itself, everything works as expected, but I did not want to put that hacky code in my projects. This is what fails:
/home/lbrueder/.sbt/0.13/global.sbt:48: error: not found: value Docker
  val (s, _) = Project.extract(newState).runTask(publish in Docker, newState)
                                                            ^
/home/lbrueder/.sbt/0.13/global.sbt:49: error: type mismatch;
 found   : Any
 required: sbt.State
  s
  ^
sbt.compiler.EvalException: Type error in expression
I am aware that it fails due to the missing docker plugin in the global scope, but I am unsure how to work around this. any suggestions :)?
RomanIakovlev
@RomanIakovlev
Jul 08 2016 08:39
You need to add dependency to Docker plugin into your plugin
I.e. in your plugin’s build.sbt: addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.3.0”)
Lena Brüder
@lenalebt
Jul 08 2016 08:40
It currently is not a plugin, just pure code in global.sbt.
and my projects do not directly depend on that plugin either, but maybe it comes through play
RomanIakovlev
@RomanIakovlev
Jul 08 2016 08:41
Well, one solution would be to make your code a plugin and add it into the global.sbt
Otherwise I don’t know how to achieve this.
Lena Brüder
@lenalebt
Jul 08 2016 08:42
okay. I'll try that. Thanks for your suggestion :)
RomanIakovlev
@RomanIakovlev
Jul 08 2016 08:43
If you would make it plugin, it’s just adding the dependency like above and putting override def requires: Plugins = DockerPlugin into the plugin object. Then it should just work.
Stephen Carman
@hntd187
Jul 08 2016 13:08
Is it easy to determine a depenendcy's transitive dependencies in sbt?
Like a module or moduleid? Or do I have to use the underlying ivy API?
Dale Wijnand
@dwijnand
Jul 08 2016 13:16
use sbt-dependency-graph
Samy Dindane
@Dinduks
Jul 08 2016 13:56
Hi. I use a plugin that extends sbt.Plugin and I want to enable it using enablePlugins() - The issue is that enablePlugins() expects sbt.Plugins and notsbt.Plugin`. Do you know how I can fix this?
Dale Wijnand
@dwijnand
Jul 08 2016 14:05
You probably want to migrate it to an AutoPlugin
Samy Dindane
@Dinduks
Jul 08 2016 14:07
@dwijnand Thanks for replying. Is that the only solution? The plugin isn't mine and I'd rather avoid fiddling with it if I could. :blush:
Dale Wijnand
@dwijnand
Jul 08 2016 14:08
It's the only one I know. I don't know sbt.Plugin. Also it's gone in 1.0.
Samy Dindane
@Dinduks
Jul 08 2016 14:09
@dwijnand Ok, thanks!
Perry
@pfn
Jul 08 2016 14:16
@Dinduks, Plugin are always enabled
so you would never enablePlugins on a Plugin
OlegYch
@OlegYch
Jul 08 2016 14:16
are they?
i thought you need to add the settings
which was a good thing..
Samy Dindane
@Dinduks
Jul 08 2016 14:18
@pfn Good. I can disable them though, right?
Perry
@pfn
Jul 08 2016 14:20
no
OlegYch, that's only if the plugin doesn't set the various overrides
Dinduks, no
@OlegYch, eg if you set buildSettings or projectSettings, it will always be applied
OlegYch
@OlegYch
Jul 08 2016 14:22
ah
Perry
@pfn
Jul 08 2016 14:22
@OlegYch, manually adding a settings Seq was the workaround for this
Samy Dindane
@Dinduks
Jul 08 2016 14:23
@pfn: I want to use two plugins P1 and P2 but theirs commands conflicts, so I thought I'd put each one of them in a subproject (S1, S2) and disable P1 for S2 and P2 for S1. I guess I can't do that?
Perry
@pfn
Jul 08 2016 14:23
@Dinduks, only if you apply them using a settings seq
Samy Dindane
@Dinduks
Jul 08 2016 14:24
@pfn You mean specifying the plugins as settings?
Perry
@pfn
Jul 08 2016 14:25
I have no idea what you're asking
Samy Dindane
@Dinduks
Jul 08 2016 14:26
@pfn what should I clarify?
Perry
@pfn
Jul 08 2016 14:27
what you're trying to say
there's no such thing as "specifying the plugins as settings"
Samy Dindane
@Dinduks
Jul 08 2016 14:29
I wasn't sure it was possible, that's why I asked :)

what do you mean by

only if you apply them using a settings seq

Dale Wijnand
@dwijnand
Jul 08 2016 14:31
I think it means you reach into the plugin and apply its settings, rather than just "enable the plugin" (for whatever that means for sbt.Plugin)
Perry
@pfn
Jul 08 2016 14:31
exactly that, if you apply the Seq[Settings[_]] in your build
vito-c
@vito-c
Jul 08 2016 16:07

@nafg still now I'd really like to know though... is a test task each test suite? each unit test?

is there anything I can do to speed up the tests then?

nafg
@nafg
Jul 08 2016 16:46
@vito-c the first step is to diagnose why they're slow
vito-c
@vito-c
Jul 08 2016 16:47
well making sure they are all run in parallel across all suites would help a bunch
that is really what I am trying to nsure
nafg
@nafg
Jul 08 2016 17:13
@vito-c what testing framework?
Have you consulted its documentation?