ScalaTest HTML report is malformatted - scalatest

I can generate the ScalaTest results in HTML but they seem malformatted like in the pic (there's no table to select the test classes)
report
I have the following versions of scalatest/pegdown:
"org.scalatest" %% "scalatest" % "3.0.0" % "test,it",
"org.pegdown" % "pegdown" % "1.0.2" % "test,it"
Have anyone experienced this before?

The problem was I was setting the scalatest version to 3.0.0 but another version, 3.0.8 was being transitively imported on the project so I added an exclusion rule to this dependency.

Related

Poky-sumo : nothing provides kernel-module-hello... error

we are currently updating our poky environment to the sumo branch and one of our recipes that build a kernel module does not work anymore. I get the following error when building image rootfs :
- nothing provides kernel-module-ourmodule-4.14.73-linux4sam_6.0-00005-g871f191fa293 needed by ourmodule.ourtarget
This recipe was working with previous version of yocto.
For testing, I made a copy of meta-skeleton/recipes-kernel/hello-mod in our layer, added hello-mod package in our image and built the image. I have the same kind of error:
Collected errors:
* Solver encountered 1 problem(s):
* Problem 1/1:
* - nothing provides kernel-module-hello-4.14.73-linux4sam_6.0-00005-g871f191fa293 needed by hello-mod-0.1-r0.our_target
*
* Solution 1:
* - do not ask to install a package providing hello-mod
Any help is welcome.
Thanks
In My case it was the following issue:
I had the module installed in a non standard kernel-module dir, when removing this it was fixed by adding
RPROVIDES_${PN} += "kernel-module-${PN}"
to the recipe.

MultipleMatchesException while using react webjar

I was using react with play-framework from webjar. While running the code MultipleMatchesException exception is thrown. After looking into the issue, I find react.production.min.js file in two locations. One in cjs and other in umd.
build.sbt line: "org.webjars" % "react" % "16.3.2"
What is the difference between cjs and umd? Why are both being downloaded and how to specify only one to use???
Thanks in advance
CJS = Common JS
UMD = Universal Module Definition
You need to be more specific in your webjars-locator usage, so something like:
#webJarsUtil.locate("umd/react.production.min.js").script()

Display project version in ASP.NET Core 1.0.0 web application

None of what used to work in RC.x helps anymore.
I have tried these:
PlatformServices.Default.Application.ApplicationVersion;
typeof(Controller).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
Assembly.GetEntryAssembly().GetName().Version.ToString();
They all return 1.0.0.0 instead of 1.0.0-9 which should be after execution of the dotnet publish --version-suffix 9 having this in project.json: "version": "1.0.0-*"
Basically they give me "File version" from the attached picture instead of "Product version" which dotnet publish actually seems to change.
For version 1.x:
Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
For version 2.0.0 this attribute contains something ugly:
2.0.0 built by: dlab-DDVSOWINAGE041 so use this one:
typeof(RuntimeEnvironment).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
I would do it like this on ASP.NET Core 2.0+
var assemblyVersion = typeof(Startup).Assembly.GetName().Version.ToString();
In .Net Core 3.1 I show the version directly in my View using:
#GetType().Assembly.GetName().Version.ToString()
This shows the Assembly Version you have in your csproj file:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>2.2.2.2</FileVersion>
<Version>4.0.0-NetCoreRC</Version>
</PropertyGroup>
If you want to display the "other" FileVersion or "Informational" Version properties in the View add using System.Reflection:
using System.Reflection;
.... bunch of html and stuff
<footer class="main-footer">
<div class="float-right hidden-xs">
<b>Assembly Version</b> #(Assembly.GetEntryAssembly().GetName().Version)
<b>File Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version)
<b>Info Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion)
</div>
</footer>
Note that after adding the System.Reflection the original #GetType().Assembly.GetName().Version.ToString() line returns 0.0.0.0 and you need to use the #Assembly.GetEntryAssembly().GetName().Version
There's a blog post here
Edit: Make sure to follow proper naming conventions for the Version strings. In general, they need to lead with a number. If you don't, your app will build but when you try to use NuGet to add or restore packages you'll get an error like 'anythingGoesVersion' is not a valid version string. Or a more cryptic error: Missing required property 'Name'. Input files: C:\Users....csproj.'
more here:
This work for me too:
#Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion
It works with csproj file - either <Version>1.2.3.4, or <VersionPrefix>1.2.3</VersionPrefix>. However the <VersionSuffix> isn't recoganized as this doc says.
The answer by Michael G should have been the accepted one since it works as expected. Just citing the answer by Michael G above.
var version = GetType().Assembly.GetName().Version.ToString();
works fine. It gets the Package version set in the Package tab of project properties.
As an addition, if we need to get the Description we set in the same tab, this code would work. (core 3.1)
string desc = GetType().Assembly.GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
Just in case someone needs this.
Happy coding !!!

R - error installing caret package

> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
> versionCheck = vI[[j]]) : namespace ‘pbkrtest’ 0.4-2 is being
> loaded, but >= 0.4.4 is required
> Error: package or namespace load
> failed for ‘caret’
Caret was working fine until I tried to load Rcpp and it messed everything up.
I searched the answers for a similar problem with caret but the solutions posted did not seem to work on mine. I followed:
install.packages("caret", dependencies = TRUE)
But it did not work.
I would suggest you to check the R version. I updated the version to 3.5.1 and it works perfectly :)
Mac only – use updateR
Similar to installr, updateR is the package to help updating R on Mac OS.
The R code you will need are the following 5 lines:
install.packages('devtools') #assuming it is not already installed
library(devtools)
install_github('andreacirilloac/updateR')
library(updateR)
updateR(admin_password = 'Admin user password')
I have the same problem with my dynlm package. I get the same error. But as R states pbkrtest is required. This package isn't available under R 3.2.3.
However you can download the package online, look a bit further on this site, the question is already asked on stackoverflow and they gave a site where you can find the packages. Then write the following code:
install.packages("...",repos = NULL, type="source")
install.packages("pbkrtest", dependencies = TRUE)
In the first line, here I wrote the 3 dots you need to write the path to the file where you placed the pbkrtest-package.
I also faced the same problem with caret package and I could solve it as the following:
install.packages("lme4", dependencies = TRUE)
library(lme4)
methods(sigma)
install.packages("pbkrtest", dependencies = TRUE)
library(caret)
This worked for me!
Try
install.packages('DEoptimR')
and followed by
install.packages("caret", dependencies = TRUE)
I had the same issues. Both of these commands worked for me.
I faced the same error with caret and none of the above suggestions helped. My R version was 3.2 and current version is 3.4.
I installed the new version and the issue was resolved
I have faced this issue and tried many ways but followed r console about error thrown and started downloading packages one by one. steps noted down what i did for this. y r studio version is "R version 3.4.4"
First install.packages("caret"), install.packages("ggplot2"), install.packages("lattice"), install.packages("lava")..
then load library(ggplot2) then library(lattice) then library(lava) and then finally library(caret).
What i believe that caret have these packages dependency so once caret is installed ideally 'install.packages('caret', dependencies = TRUE)' should work but it was not working in my R version so i did the step as given above and it worked for me.
hope it may work if someone get this issue
I did try all the above mentioned ways to install and activate caret but none worked for me.
finally what I did was to go to my drive location where R libraries are located. I removed a folder called "caret" and then in R studio I run "remove.packeges("caret")" to remove the caret package.
then I reinstalled the package.
install.packages("caret")
library(caret)
it worked for me.
I'm in R 3.6.1 and got the same error today.
I used this code:
install.packages("caret",dep = TRUE)
install.packages("ggplot2")
install.packages("lattice")
install.packages("lava")
install.packages("purrr")
library(ggplot2)
library(lattice)
library(lava)
library(purrr)
library(caret)
And now it works fine for me. It's all about dependencies that you should install with caret.
Use this:
install.packages(c("ggplot2", "lattice", "lava", "purrr", "caret"))
library(c("ggplot2", "lattice", "lava", "purrr", "caret"))
If that doesn't work, create a folder (R_LIB in this case) on your computer (documents in this case) and include the folder location as follow:
install.packages(c("ggplot2", "lattice", "lava", "purrr", "caret"), lib = "C:/documents/R_LIB")
library(c("ggplot2", "lattice", "lava", "purrr", "caret"), lib = "C:/documents/R_LIB")

Playframework 2.1.x Database Error

I try to add a database to my play framework app but I have several problems. I used the template (from Typesafe Activator) called "hello-play-2_3-scala". I always get an error if i try to insert 'import play.api.db._'. I looked at this instruction for the play database, but the main problem is I haven't any Build.scala file in my project folder. Also I cannot create once, just Java Files (I use Intellj Idea). I hope someone can help me.
Thanks!
Greetings Chryb.
You should add jdbc dependency inside build.sbt file. It should look like this:
name := """hello-play-2_3-scala"""
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
PlayKeys.jdbc,
"org.webjars" %% "webjars-play" % "2.3-M1",
"org.webjars" % "bootstrap" % "2.3.1",
"org.webjars" % "requirejs" % "2.1.11-1"
)
lazy val root = (project in file(".")).addPlugins(PlayScala)

Resources