Meteortesting mocha Code Coverage Error: Failed to save json / html report - meteor

Meteor Coverage does not create coverage report:
Error: Failed to save html report // same with json
at packages/meteortesting:mocha/server.handleCoverage.js:37:18
at runWithEnvironment (packages/meteor.js:1286:24)
i do my call with:
COVERAGE_OUT_JSON=1 COVERAGE_VERBOSE=1 COVERAGE=1 COVERAGE_APP_FOLDER=$PWD meteor test --once --full-app --driver-package meteortesting:mocha --extra-packages lmieulet:meteor-coverage
meteor version 1.11.1
nodejs version 12.18
lmieulet:meteor-coverage#3.2.0

Related

Next JS deployment fail on Amazon Amplify ERR

I am trying to deploy an SSG app on Next JS but it's failing again and again I am getting an error of build failed. I have followed the documentation for deploying an SSG site on amazon but still, I am getting errors I don't know what's wrong.
Below is the log of my amplify app:
en
# Starting phase: preBuild
# Executing command: npm ci
2022-10-19T06:14:55.093Z [WARNING]: npm
2022-10-19T06:14:55.095Z [WARNING]: ERR! caniuse-lite not accessible from browserslist
2022-10-19T06:14:55.129Z [WARNING]:
2022-10-19T06:14:55.129Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-10-19T06_14_55_093Z-debug.log
2022-10-19T06:14:55.129Z [HELP]: Outputting the npm debug log
[object Promise]
2022-10-19T06:14:55.135Z [ERROR]: !!! Build failed
2022-10-19T06:14:55.135Z [ERROR]: !!! Non-Zero Exit Code detected
2022-10-19T06:14:55.135Z [INFO]: # Starting environment caching...
2022-10-19T06:14:55.137Z [INFO]: # Environment caching completed
Terminating logging...

prisma db seed & typescript problem with import and type:module

I learning prisma from this tutorial:
https://www.prisma.io/blog/fullstack-nextjs-graphql-prisma-oklidw1rhw
I have problem with step:
npx prisma db seed --preview-feature
I copy 1;1 code from this tutorial, and when I run:
npx prisma db seed --preview-feature
I get error:
prisma:warn Prisma "db seed" was in Preview and is now Generally Available.
You can now remove the --preview-feature flag.
prisma:warn The "ts-node" script in the package.json is not used anymore since version 3.0 and can now be removed.
Environment variables loaded from .env
Running seed command `ts-node prisma/seed.ts` ...
(node:34420) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/m/dev/prisma/awesome-links/part-1/prisma/seed.ts:38
import Prisma from '#prisma/client';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Module.m._compile (/Users/m/dev/prisma/awesome-links/part-1/node_modules/ts-node/src/index.ts:1455:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Object.require.extensions.<computed> [as .ts] (/Users/m/dev/prisma/awesome-links/part-1/node_modules/ts-node/src/index.ts:1458:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at phase4 (/Users/m/dev/prisma/awesome-links/part-1/node_modules/ts-node/src/bin.ts:567:12)
An error occured while running the seed command:
Error: Command failed with exit code 1: ts-node prisma/seed.ts
When I add'ed to package.json "type":"module", I get error:
m#ms-MacBook-Pro ~/d/p/a/part-1 (part-1) [1]> npx prisma db seed --preview-feature
prisma:warn Prisma "db seed" was in Preview and is now Generally Available.
You can now remove the --preview-feature flag.
prisma:warn The "ts-node" script in the package.json is not used anymore since version 3.0 and can now be removed.
Environment variables loaded from .env
Running seed command `ts-node prisma/seed.ts` ...
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/m/dev/prisma/awesome-links/part-1/prisma/seed.ts
at new NodeError (node:internal/errors:371:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:87:11)
at defaultGetFormat (node:internal/modules/esm/get_format:102:38)
at defaultLoad (node:internal/modules/esm/load:21:14)
at ESMLoader.load (node:internal/modules/esm/loader:359:26)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:280:58)
at new ModuleJob (node:internal/modules/esm/module_job:66:26)
at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:297:17)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:261:34)
at async Promise.all (index 0) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
An error occured while running the seed command:
Error: Command failed with exit code 1: ts-node prisma/seed.ts
I reading similar problem on StackOverflow, github etc, but any case not working, anyone can help me?
Try and double-check your seed command in the prisma section of your package.json, it should look like the one in the repo of the guide you've linked:
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
From the error you've pasted you're missing the --compiler-options parameter.

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.

MSBuild Error: Reading build config file results in cordova-build error : TypeError: undefined is not a function -Android

I ran in to this problem while performing Apache cordova build through visual studio-2015 i get this following error.
VS2015;
npm -v - 5.7.1
Node -v 8.8.0
Cordova tools 6.5.0
Android project created with cordova-android#6.4.0
Last few lines of error log
> Prepared android project successfully
> No scripts found for hook "after_prepare".
> Checking config.xml for saved plugins that haven't been added to the project
> ------ Copied C:\Project\Mobile\bin\Android\Debug\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
> ------ Building platform: android
> Debug
> ------ Build configuration options: --debug
> No scripts found for hook "before_compile".
> ANDROID_HOME=C:\Users\<username>\AppData\Local\Android\sdk
> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
> Reading build config file: C:\Project\Mobile\build.json
> MSBUILD : cordova-build error : TypeError: undefined is not a function
> TypeError undefined is not a function
Any help is appreciated.
I think is node version related issue.
After a few try to build with VS Cordova Tools and latest version of Cordova, i have encountred some issues on latest node versions.
Try to downgrade node to Node 4.8.7 LTS
https://nodejs.org/en/blog/release/v4.8.7/

Potential conflict between polymer build and tur-nr/polymer-redux

Description
I am experiencing unexpected errors when running polymer build after installing and using tur-nr/polymer-redux. Here is the demo repo.
Versions & Environment
polymer-build: v0.18.3 polymer --version
node: v6.10.2
Operating System: macOS Sierra v10.12.4
Steps to reproduce
terminal
git clone https://github.com/maria-le/redux # clone remote repo to your local
cd redux # cd into your local repo
bower install # install bower dependencies
npm install redux # install redux
polymer build # attempt build
Expected results
I expect the build to complete, without errors. Then allow me to serve the packaged build.
Actual results
I get the following errors in the terminal.
Error messages
src/all-locally.html(14,16) error [unknown-polymer-behavior] - Unable to resolve behavior store. Did you import it? Is it annotated with #polymerBehavior?
ReduxStore
src/imported-behavior.html(7,16) error [unknown-polymer-behavior] - Unable to resolve behavior ReduxStore. Did you import it? Is it annotated with #polymerBehavior?
polymerStore
src/imported-store-as-variable.html(10,16) error [unknown-polymer-behavior] - Unable to resolve behavior polymerStore. Did you import it? Is it annotated with #polymerBehavior?
PolymerRedux(reduxStore)
src/imported-store.html(7,16) warning [could-not-determine-behavior-name] - Could not determine behavior name from expression of type
CallExpression
error: Promise rejection: Error: 3 error(s) occurred during build.
error: Error: 3 error(s) occurred during build.
at BuildAnalyzer._done (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:229:36)
at BuildAnalyzer. (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:189:26)
at next (native)
at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
References
How to use polymer-redux with polymer-build?
polymer lint and polymer-build fail due to ReduxBehavior not registering properly
#polymerBehavior should still produce a behavior even if we can't evaluate the expression

Resources