Error - Expected ';' while running Gatling using sbt - sbt

I am running a Gatling test script using Jenkins on a Unix machine. The test and the Simulation passes successfully after which I am seeing the below error marked in bold below also causing the Jenkins build to fail.
Log from the Jenkins build
Reports generated in 0s.
Please open the following file: >/var/lib/jenkins/workspace/gatling_test_job/target/gatling/demoscript-20200930173820423/index.html
[info] Simulation DemoScript successful.
[info] Simulation(s) execution ended.
[success] Total time: 326 s (05:26), completed Sep 30, 2020 5:43:32 PM
>[error] Expected ';'
[error] com.test.performance.DemoScript
[error] ^
Build step 'Build using sbt' changed build result to FAILURE
Build step 'Build using sbt' marked build as failure
I am using build using sbt block in my Jenkins job to trigger the test using the below command
gatling:testOnly com.test.performance.DemoScript
Scala Version is - 2.12.10
Gatling and related libraries - 3.3.1
Build using sbt config in Jenkins
sbt installation in global tool configuration

Related

Dotnet test questions on errors

I am working on Azure pipelines, running on a Windows self-hosted agent, behind a firewall to run automated tests.
I would want to see the tests results and code coverage in the pipeline results in Azure. My build pipelines are working but I never saw yet the results of automated tests so I'm not sure of what to expect.
I run this in my pipeline:
- job: Test
steps:
- task: NuGetAuthenticate#0
- task: DotNetCoreCLI#2
inputs:
command: test
projects: 'src/***.Test.Core/*.csproj'
testRunTitle: '***Tests'
arguments: '--collect "Code coverage"'
publishTestResults: true
Here are extracts of the logs, with my questions and comments:
Initialization of proxies and general stuff
##[debug]Agent.ProxyUrl=http://***proxy.***.***:443
##[debug]Agent.ProxyBypassList=["***.***,localhost,127.0.0.1","***.***","localhost","127.0.0.1"]
##[debug]Agent.CAInfo=*:\***Certificates\***PKIG2PEM.txt
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]command=test
##[debug]projects=src/***.Test.Core/*.csproj
##[debug]arguments=--collect "Code coverage"
##[debug]publishWebProjects=true
##[debug]workingDirectory=*:\Agent\_work\24\s
##[debug]check path : *:\Agent\_work\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.179.2\node_modules\packaging-common\module.json
##[debug]adding resource file: *:\Agent\_work\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.179.2\node_modules\packaging-common\module.json
Not sure what is CHCP but tests are run, with errors I believe linked to firewall so I'd expect to see those errors in the tests results
[command]C:\Windows\system32\chcp.com 65001
##[debug]publishTestResults=true
##[debug]Agent.TempDirectory=*:\Agent\_work\_temp
##[debug]defaultRoot: '*:\Agent\_work\_temp'
##[debug]pattern: '**/*.trx'
Results File: E:\Agent\_work\_temp\***_***_2020-12-17_16_13_24.trx
Attachments:
*:\Agent\_work\_temp\d992768e-f36f-4558-9b52-f42fc7cd3c74\***_***_2020-12-17.16_13_16.coverage
Failed! - Failed: 29, Passed: 0, Skipped: 0, Total: 29, Duration: 3 s - OECD.Glue.Contacts.API.Test.Core.dll (netcoreapp3.1)
Errors when pushing the results, what means "Failed to get FF TestManagement.Server.UsePublishTestResultsLibInAgent Value." ?
##[debug]Exit code 1 received from tool 'C:\Program Files\dotnet\dotnet.exe'
##[debug]STDIO streams have closed for tool 'C:\Program Files\dotnet\dotnet.exe'
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
##[debug]Processed: ##vso[task.issue type=error;]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
##[debug]BuildConfiguration=undefined
##[debug]BuildPlatform=undefined
##[debug]testRunTitle=***Tests
##[debug]adjustedPattern: '*:\Agent\_work\_temp\**/*.trx'
##[debug]Failed to get FF TestManagement.Server.UsePublishTestResultsLibInAgent Value.
Unable to get the FF: TestManagement.Server.EnablePublishToTcmServiceDirectlyFromTask. Reason: One or more errors occurred. (Moved Temporarily)
Failed to get FF TestManagement.PTR.CalculateTestRunSummary, what is CalculateTestRunSummary ?
##[debug]Failed to get FF TestManagement.PTR.CalculateTestRunSummary Value.
##[debug]Reading test results from file '*:\Agent\_work\_temp\***_***_2020-12-17_16_13_24.trx'
##[debug]Processed: ##vso[results.publish type=VSTest;mergeResults=false;runTitle=GlueContactsTests;publishRunAttachments=true;resultFiles=*:\Agent\_work\_temp\*_***_2020-12-17_16_13_24.trx;testRunSystem=VSTS - dotnet;]
I wonder what to do with these warnings, I don't know much about Dotnet core and Nuget, my job is only the pipeline, not the underlying project. In project settings, I see .Net Core 3.1, I don't understand where to look to find if I use Nuget version < 5.7 and if this warning applies to me
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
##[debug]Processed: ##vso[task.issue type=warning;].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) Use global.json using an older sdk version(<=3) to build
##[debug]task result: Failed
Then I have this, publish test results ends with Moved Temporarily, I'm guessing this is because of firewall, still, I did setup the proxy and other calls to Azure seems to work, what could be the issue ?
##[error]Dotnet command failed with non-zero exit code on the following projects : *:\Agent\_work\24\s\src\***.Test.Core\***.Test.Core.csproj
##[debug]Processed: ##vso[task.issue type=error;]Dotnet command failed with non-zero exit code on the following projects : E:\Agent\_work\24\s\src\***.Test.Core\***.Test.Core.csproj
##[debug]Processed: ##vso[task.complete result=Failed;]Dotnet command failed with non-zero exit code on the following projects : E:\Agent\_work\24\s\src\***.Core\***.Test.Core.csproj
##[section]Async Command Start: Publish test results
##[warning]Failed to publish test results: Moved Temporarily
##[section]Async Command End: Publish test results
##[section]Finishing: DotNetCoreCLI
Thanks for any help, Claude
Update 1 ---------------------------------
Thank you.
I understood that my version of DotNet Core on the agent is not good,
the agent has version 5 while the project references version 3.1.
I added this task :
- task: UseDotNet#2
inputs:
packageType: 'sdk'
version: '3.1.x'
But I am behind a firewall, still I have these logs:
##[debug]agent.proxyurl=http://***proxy.***.***:443
##[debug]agent.proxyusername=undefined
##[debug]agent.proxypassword=undefined
##[debug]agent.proxybypasslist=["***.***,localhost,127.0.0.1","***.***","localhost","127.0.0.1"]
##[debug]agent.proxybypasslist=["***.***,localhost,127.0.0.1","***.***","localhost","127.0.0.1"]
##[debug]AZURE_HTTP_USER_AGENT=VSTS_c11775e3-cd05-4e03-abd2-35da98ef2f0f_build_164_0
Tool to install: .NET Core sdk version 3.1.x.
##[debug]task result: Failed
##[error]Failed to download or parse releases-index.json with error: {"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"}
Would it be best to install this version locally ? In that case, would I have to do something special so it uses the correct version ?
Update 2 ---------------------------------
Thanks for that link to a known issue. I noticed that issue doesn't mention an error I have: {"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"}
Can it be that the task tries to reach 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json' but can't as we are behind a firewall ??
I don't understand why it tries to install DotNet Core as it is already installed but I don't know much about DotNet Core, I am only trying to run automated tests.
My last test included:
- task: NuGetAuthenticate#0
displayName: 'Authenticate with NuGet'
- task: UseDotNet#2
inputs:
packageType: 'sdk'
version: '3.1.101'
installationPath: '$(Agent.ToolsDirectory)/dotnet'
- task: DotNetCoreCLI#2
inputs:
command: test
projects: 'src/myProject.Test.Core/*.csproj'
testRunTitle: 'myProject'
arguments: '--collect "Code coverage"'
publishTestResults: true
Logs contains:
##[debug]agent.proxyurl=http://proxy.myCie.com:443
##[debug]agent.proxyusername=undefined
##[debug]agent.proxypassword=undefined
##[debug]agent.proxybypasslist=["myCie.com,localhost,127.0.0.1","myCie.com","localhost","127.0.0.1"]
##[debug]agent.proxybypasslist=["myCie.com,localhost,127.0.0.1","myCie.com","localhost","127.0.0.1"]
##[debug]AZURE_HTTP_USER_AGENT=VSTS_xxx_build_173_0
Tool to install: .NET Core sdk version 3.1.101.
##[debug]task result: Failed
##[error]Failed to download or parse releases-index.json with error: {"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"}
##[debug]Processed: ##vso[task.issue type=error;]Failed to download or parse releases-index.json with error: {"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"}
##[section]Finishing: UseDotNet
Thanks for any help
I think this is similar to GitHub issue #10969. It has something to do with internal GitHub repo/url. This is because the version which we specify in the task is searched in releases-index file, which is accessible to public as well:
You could also check the releases-index.json
{
"channel-version": "3.1",
"latest-release": "3.1.10",
"latest-release-date": "2020-11-10",
"security": false,
"latest-runtime": "3.1.10",
"latest-sdk": "3.1.404",
"product": ".NET Core",
"support-phase": "lts",
"eol-date": "2022-12-03",
"releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json"
},
In this case, I would recommend you to reopen the Issue #10969.

Pivotal .NetCore 3.1 dotnet-runtime Error During Deployment

I want to deploy my project using Pivotal from Bamboo. During the deployment of my .NetCore 3.1 project, I'm getting the error "Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install". The deployment stack is set to cflinuxfs3.
I've tried specifying dotnet runtime version (3.1 and 3.1.5) in .csproj file but it got the same error so I removed it.
I've also created a buildpack.yml file and specified the .netcore sdk version as 3.1.x in there.
I'm sharing the property group from csproj and the manifest.yml file.
-- Error Log --
Downloading app package...
Downloaded app package (6.4M)
-----> Dotnet-Core Buildpack version 2.3.12
-----> Supplying Dotnet Core
-----> Installing libunwind 1.4.0
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/a54cfafce3d2a14e4f96777d5fd471f4/libunwind_1.4.0_linux_noarch_cflinuxfs3_05e08b22.tgz]
using the default SDK
-----> Installing dotnet-sdk 3.1.301
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/b422801667458a262ba26a3117b93e4f/dotnet-sdk_3.1.301_linux_x64_any-stack_80a771e4.tar.xz]
-----> Installing dotnet-runtime 3.1.5
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/40b5a460524fe7f1795c876445349a31/dotnet-runtime_3.1.5_linux_x64_any-stack_1aa84612.tar.xz]
-----> Finalizing Dotnet Core
ERROR Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install Failed to compile droplet: Failed to
run finalize script: exit status 12 Exit status 223 Cell
ffe536bc-374c-46b5-a620-e3366dab6b22 stopping instance
b71ecb48-0083-4fd1-8f59-3a77b05de0e0
Error staging application: App staging failed in the buildpack compile
phase
-- .csproj --
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
-- manifest.yml --
---
applications:
- name: projectName
memory: 1G
timeout: 240
instances: 1
routes:
- route: routeAddress
services:
- ARCHITECTURE.SERVICES-TST.ServiceRegistry
- ProjectName.Redis
- ProjectName.Dynatrace
- ProjectName.ConfigServer
env:
DT_TAGS: ((appName)) ((dc))-((env))
TZ: country
ASPNETCORE_ENVIRONMENT: environmentName
SPRING_CLOUD_CONFIG_LABEL: configLabel
Ok, here's what is happening.
The code is looking at the RuntimeFrameworkVersion in your .csproj file.
When that is empty, it's going to look at the TargetFramework and attempt to find a substring match using the regex netcoreapp(.*).
It is expecting that to have a single match, but in your case it does not, so you get that error message: could not find a version of dotnet-runtime to install.
Based on your .csproj file, it seems like what you have should be OK though. I did a quick check and the regex works and returns the version.
You could try setting RuntimeFrameworkVersion which would take a slightly different code path and might work for you.
You are trying to perform a source-based deployment. You could try dotnet publish first followed by a Framework Dependent Deployment which again would force a different code path.
It might be that the buildpack isn't finding your file, but it's hard to say without more info.

Facing issue while building Corda Version 1

I am getting below error while building Corda Version 1 (branch name - release-V1)
Task :core:test
net.corda.core.flows.ContractUpgradeFlowTest > 2 parties contract upgrade using RPC FAILED
java.util.concurrent.TimeoutException at ContractUpgradeFlowTest.kt:123
329 tests completed, 1 failed
FAILURE: Build failed with an exception.
Please help...
You can build the project without running the tests by using the command ./gradlew build -x test or gradlew.bat build -x test.
The integration tests can occasionally time-out, so I wouldn't be concerned by this issue. We are working to fix this.
In general, you shouldn't need to build Corda itself. The binaries for release-V1 are published to Maven, so will be downloaded automatically. You should probably work from the templates:
https://github.com/corda/cordapp-template-java
https://github.com/corda/cordapp-template-kotlin

JavaFX to Android - Execution failed for task ':deleteSrcAndLayout'

good day, I got an issue in creating an android project, Im currently using windows7 with JDK8u40 installed and Im using the latest dalvik sdk. But when I attempted to create an android project, an error was thrown:
* What went wrong:
Execution failed for task ':deleteSrcAndLayout'.
> Directory does not exist: C:\AndroidFX\CodeGenerator\src
Here's the complete error log:
C:\dalvik-sdk\samples\Ensemble8>./gradlew --info createProject -PDEBUG -PDIR=C:/
AndroidFX -PPACKAGE="hello" -PNAME="CodeGenerator" -PANDROID_SDK=C:/AndroidSDK/s
dk -PJFX_SDK=C:/dalvik-sdk -PJFX_APP=C:/Jar -PJFX_MAIN="hello.Hello"
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file 'C:\dalvik-sdk\samples\Ensemble8\
build.gradle'.
Included projects: [root project 'Ensemble8']
Evaluating root project 'Ensemble8' using build file 'C:\dalvik-sdk\samples\Ense
mble8\build.gradle'.
Starting file lock listener thread.
All projects evaluated.
Selected primary task 'createProject'
Tasks to be executed: [task ':conf', task ':androidCreateProject', task ':delete
SrcAndLayout', task ':writeAntProperties', task ':updateManifest', task ':update
StringsXml', task ':updateBuildXml', task ':createProject']
:conf (Thread[main,5,main]) started.
:conf
Executing task ':conf' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
====================================================
Android SDK: [C:/AndroidSDK/sdk]
Target: [android-21]
Project name: [CodeGenerator]
Package: [hello]
JavaFX application: [C:/Jar]
JavaFX sdk: [C:/dalvik-sdk]
JavaFX main.class: [hello.Hello]
Workdir: [C:/AndroidFX]
debug: [true]
===================================================
:conf (Thread[main,5,main]) completed. Took 0.078 secs.
:androidCreateProject (Thread[main,5,main]) started.
:androidCreateProject
Executing task ':androidCreateProject' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
Starting process 'command 'C:/AndroidSDK/sdk/tools/android.bat''. Working direct
ory: C:\AndroidFX Command: C:/AndroidSDK/sdk/tools/android.bat create project -n
CodeGenerator -p CodeGenerator -t android-21 -k hello -a Activity
An attempt to initialize for well behaving parent process finished.
Successfully started process 'command 'C:/AndroidSDK/sdk/tools/android.bat''
Error: Package name 'hello' contains invalid characters.
A package name must be constitued of two Java identifiers.
Each identifier allowed characters are: a-z A-Z 0-9 _
Proces
s 'command 'C:/AndroidSDK/sdk/tools/android.bat'' finished with exit value 0 (st
ate: SUCCEEDED)
:androidCreateProject (Thread[main,5,main]) completed. Took 1.375 secs.
:deleteSrcAndLayout (Thread[main,5,main]) started.
:deleteSrcAndLayout
Executing task ':deleteSrcAndLayout' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:deleteSrcAndLayout FAILED
:deleteSrcAndLayout (Thread[main,5,main]) completed. Took 0.594 secs.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\dalvik-sdk\samples\Ensemble8\build.gradle' line: 203
* What went wrong:
Execution failed for task ':deleteSrcAndLayout'.
> Directory does not exist: C:\AndroidFX\CodeGenerator\src
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to
get more log output.
BUILD FAILED
Total time: 6.531 secs
Please help me!! Im stuck!!!!
I also tried JDK7u75 but it didnt worked!!
I successfully created an android project by editing the createHelloWorld.bat under android-tools in the dalvik-sdk.

Flexmojos, Flexunit4: adl returns Unexpected return code 9

I got problem when running flexunit4 unit test
Flexmojos 4.2-beta
Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
Running tests /Users/mordesku/NetBeansProjects/way2learn/builder/target/test-classes/TestRunner.swf
[LAUNCHER] Using regular flashplayer tests
------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1:10.516s
Finished at: Fri Dec 07 09:53:52 CET 2012
Final Memory: 11M/213M
------------------------------------------------------------------------
Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta:test-run (default-test-run) on project builder: Unexpected return code 9 - /Users/mordesku/NetBeansProjects/way2learn/builder/target/test-classes/TestRunner.swf -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
When i am running adl from command line (from target directory), got this output:
jablecznik:test-classes mordesku$ adl TestRunner.xml
error while loading initial content
jablecznik:test-classes mordesku$
Root node of TestRunner.xml looks like this:
<application xmlns="http://ns.adobe.com/air/application/2.6">
When I changed it to
<application xmlns="http://ns.adobe.com/air/application/3.5">
Test from command line run normally.
Has anyone has the same problem as i? How configure flexmojos to output TestRunner.xml witch difrent version of airapplication version?

Resources