+ slather coverage --binary-basename Project --input-format profdata -i '.*Tests.*' --cobertura-xml --output-directory sonar-reports --workspace Project.xcworkspace --scheme ProjectTests Project.xcodeproj
ERROR: Unrecognised option '--workspace'
See: 'slather coverage --help'
+ returnValue=1
+ set +x
ERROR - Command 'slather coverage --binary-basename Project --input-format profdata -i .*Tests.* --cobertura-xml --output-directory sonar-reports --workspace Project.xcworkspace --scheme ProjectTests Project.xcodeproj'
failed with error code: 1
Parameters which I have specified as follows.
workspaceFile=''; readParameter workspaceFile 'sonar.swift.workspace'
slatherCmd+=( --input-format profdata $excludedCommandLineFlags --cobertura-xml --output-directory sonar-reports)
if [[ ! -z "$workspaceFile" ]]; then
echo "$workspaceFile"
slatherCmd+=( --workspace $workspaceFile)
In the sonar project.properties I have mentioned the workspace.
Getting this error while working with Xcode, Jenkins, and Sonar Qube.
What could be wrong with the command? Did I miss something?
Slather is installed in mac, is there something that I have to set up before running Xcode?
I tried installing Slather but I don't know why it is showing that.
Related
I am trying to containerize my application build, though, when running the build that uses bazel with bazel-gazelle inside a container I will get this error:
$ bazel run --spawn_strategy=local //:gazelle --verbose_failures
INFO: Analyzed target //:gazelle (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/BUILD.bazel:43:15: GoToolchainBinary external/go_sdk/builder [for host] failed: (Exit 1): go failed: error executing command
(cd /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/execroot/__main__ && \
exec env - \
GOROOT_FINAL=GOROOT \
external/go_sdk/bin/go tool link -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a)
# Configuration: e0f1106e28100863b4221c55fca6feb935acec078da5376e291cf644e275dae5
# Execution platform: #local_config_platform//:host
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
Target //:gazelle failed to build
INFO: Elapsed time: 2.302s, Critical Path: 0.35s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
I tried to run it standalone:
$ /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/bin/go tool link -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
and still got no success.
Never had this kind of link problem and the linker don't provide much more information. Tried to install all packages I could think of and still no luck.
For context:
Running Ubuntu 20.04 LTS
Docker 20.10.9
Bazel 4.2.2
Rules GO v0.31.0
Bazel Gazelle v0.25.0
Also tried to run it with the strace, though I don't think I am skilled enough to find meaningful information from the tool output.
#edit
For more context:
e$ /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/bin/go tool link -v -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a
HEADER = -H5 -T0x401000 -R0x1000
searching for runtime.a in /opt/go/pkg/linux_amd64/runtime.a
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
I have the following setup. Kotlin Multiplatform project with a Web App and Shared module. I also have included a build of a library that I had to modify myself as it wasn't working properly.
When trying to deploy to Heroku with these steps I get the following error
> Task :common:root:jsPackageJson
> Task :web-app:packageJson
> Task :web-app:testPackageJson
> Task :rootPackageJson
> Task :kotlinNpmInstall
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/LICENSE'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/data/features/getcomputedstyle.js'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall FAILED
> Task :kotlinNpmInstall FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':firebase-kotlin-sdk:kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 5m 20s
18 actionable tasks: 18 executed
! ERROR: Failed to run Gradle!
We're sorry this build is failing. If you can't find the issue in application
code, please submit a ticket so we can help: https://help.heroku.com
You can also try reverting to the previous version of the buildpack by running:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
Thanks,
Heroku
! Push rejected, failed to compile Gradle app.
! Push failed
Tried running kotlinNpmInstall locally on both the library and the whole project and it works properly, with no failures.
While I do not know the exact cause, it seems that multiple yarn process are spawned that corrupt each other's packages.
This can be solved with the mutex option.
To add yarn options to a kotlin/js project you can add a .yarnrc file to the root of your project.
My .yarnrc's content:
--install.mutex network
This makes yarn use a predefined port on the network for its mutex.
When building my app using fastlane gym I'm getting error: Unexpected duplicate tasks:. When I run into this issue using Xcode I can get rid of it by setting the build system to the legacy build system. I would like to be able to set the build system using fastlane but have not found the correct way to pass it in using xcarg.
I've tried using this command. fastlane gym --xcargs "UseModernBuildSystem=no"
Which in turn runs this: set -o pipefail && xcodebuild -workspace ./PolyAcademy.xcworkspace -scheme PolyAcademy -destination 'generic/platform=iOS' -archivePath /Users/mattmarshall/Library/Developer/Xcode/Archives/2019-10-21/PolyAcademy\ 2019-10-21\ 16.21.58.xcarchive UseModernBuildSystem=no archive | tee /Users/mattmarshall/Library/Logs/gym/PolyAcademy-PolyAcademy.log | xcpretty
I'd like for this not to appear and for the app to build.
[16:22:00]: ▸ 2019-10-21 16:22:00.145 xcodebuild[32252:315891] DTDeviceKit: deviceType from 870b9074181ce2e0318a5477d3bd3536633ee1ee was NULL
[16:22:01]: ▸ ❌ error: Unexpected duplicate tasks:
[16:22:01]: ▸ ** ARCHIVE FAILED **```
I solved adding
export_xcargs: {
useModernBuildSystem: "NO"
}
to my build_ios_app config in the fastfile
I'm testing my application with mocha along with istanbul.
For coverage and testing i'm using the following entries in my package.json
"test:integration": "cross-env NODE_ENV=test mocha --timeout 20000 src/api/tests/integration",
"coverage": "nyc report --reporter=text-lcov | coveralls",
The test passes, but when doing yarn coverage i'm getting an error
$ nyc report --reporter=text-lcov | coveralls
[error] "2018-08-04T21:25:57.261Z" 'error from lcovParse: ' 'Failed to parse string'
[error] "2018-08-04T21:25:57.263Z" 'input: ' ''
[error] "2018-08-04T21:25:57.263Z" 'error from convertLcovToCoveralls'
C:\Users\Mikk\Documents\GitHub\backend\node_modules\coveralls\bin\coveralls.js:18
throw err;
^
Failed to parse string
Any ideas? I even tried to reinstall the node modules, but that doesn't seem to fix anything.
I had the same set up in my package.json file and the same issues earlier today but I fixed it by refreshing my repo attached to Coveralls.io
After refreshing, I restarted build on Travis CI and it worked.
Ensure you have the following in your project root dir
.coveralls.yml -- It should contain repo_token if you're using a public repo
The instructions for running tests with the Jenkins XCode plugin say to set the test target (which I've done), the SDK (which I've done) and the configuration (which I tried with nothing, Debug, and Test).
However I keep getting "...is not configured for running".
How do I actually get it to run tests?
This is the output:
+ xcodebuild -workspace /Users/MyDir/.Jenkins/jobs/MyTests/workspace/folder/MyWorkspace.xcworkspace -scheme MyTestScheme clean
xcodebuild: error: Failed to build workspace MyWorkspace with scheme MyTestScheme.
Reason: Scheme "MyTestScheme" is not configured for running.
If within XCode for MyTestScheme if I choose Product/Run then I get the same error message, but if I choose Product/Test then the test code executes successfully. The output from a sucessful run in Xcode is:
2013-08-28 11:10:25.828 otest[65917:303] Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size
Test Suite 'Multiple Selected Tests' started at 2013-08-28 18:10:26 +0000
Test Suite '/Users/MyDir/Library/Developer/Xcode/DerivedData/MyWorkspace-ctngidolzdhijvbymvghygtoaiiw/Build/Products/Debug-iphonesimulator/MyTestScheme.octest(Tests)' started at 2013-08-28 18:10:26 +0000
Test Suite 'MyTests' started at 2013-08-28 18:10:26 +0000
Test Case '-[MyTests test1]' started.
2013-08-28 11:10:26.029 otest[65917:303] MDN: (null)
Test Case '-[MyTests testA1]' passed (0.346 seconds).
For me the problem was using the test schema. The debug schema should be used instead.
To configure the Xcode plugin for unit testing you need to write "test" in the "Custom xcodebuild arguments" field inside the "Advanced Xcode build options".
XCode plugin maintainer here. I don't know the answer, but I would love to help you out.
Have you tried fiddling with the destination argument ?
E.g. -destination 'OS=8.0,name=iPhone'
or -destination 'platform=iOS Simulator,OS=8.0,name=iPhone 6s'
(adjust depending on your needs)
If that doesn't work, please try to copy the output generated by the run of the tests from XCode itself.