Jest showing error on passed test on Azure - azure

When I run jest test locally I see all my tests as passed.
PASS apps/web/customers/src/components/TelephoneDial/tests/TelephoneDialButton.test.tsx
When I run jest test in my build on Azure I get the following:
'##[error]PASS apps/web/customers/src/components/TelephoneDial/tests/TelephoneDialButton.test.tsx (8.186s)
During the actual build step on azure I also see this:
'##[error]lerna notice cli v3.13.4
While locally it shows:
lerna notice cli v3.13.4
Why is Azure showing this output as errors?

I haven't found what's causing this issue, but switching from Windows 2019 with VS2019 agent to vs2017-win2016 has fixed the issue, now the output doesn't report errors.

Related

An unknown error has occurred. Check the diagnostic log for details

New to Azure : I am using azure free service to host react website using vs code extension Azure App Service.
While deploying I am getting following error with no specific details
Using Node version:
v14.18.3
Using Npm version:
6.14.15
Running 'npm install --unsafe-perm'...
> react-scripts build
Creating an optimized production build...
An unknown error has occurred. Check the diagnostic log for details.
Deployment failed.
Inside Azure All Service :- microsoft.alertsmanagement/smartdetectoralertrules
Failure Anomalies notifies you of an unusual rise in the rate of failed HTTP requests or dependency calls.
Steps to reproduce
First deployment worked for me
After adding new dependancy in package.json it is not working (previously worked adding same dependancy)
Adding new png assets to project is failed, every time reason is different of failing
Trials to solve
Deleted projects and re created
Updated project dependancy
New project created but its fails after some changes to project
Please help to solve this problem

npm run graphql-deploy command stuck in Sanity

When I am running, the command npm run graphql-deploy in my local it stuck at lerna info Executing command in 1 package: "npm run graphql-deploy". Not moving forward.
And if I run same command in studio folder it stuck at:
GraphQL API deployed to:
https://qht1v59y.api.sanity.io/v1/graphql/development/default
Please refer screenshot
So due to this I am not able to deploy my changes. What's the issue here. How to fix this ?
If you never found a fix for this, it was merged into #sanity/cli. I just updated it and seems tow work fine now.
https://github.com/sanity-io/sanity/pull/2987

Deployment error. Build failed: Build error details not available. Firebase Cloud Functions

I reinstalled multiple times NPM and Node on my pc.
(npm version 7.4.3)
(node version v15.7.0)
I followed the procedure for configuring the Firebase CLI with:
npm install -g firebase-tools
and firebase init and firebase deploy and the configuration seems to work fine.
The problem I'm facing happens when I open the index.js file and I uncomment the stock helloWorld function which looks like this:
exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});
I run firebase deploy and I receive this error
functions[helloWorld(us-central1)]: Deployment error.
Build failed: Build error details not available. Please check the logs at https://console. {urlStuff}
Functions deploy had errors with the following functions:
helloWorld
To try redeploying those functions, run:
firebase deploy --only "functions:helloWorld"
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
I honestly don't know what to do now.
I tried multiple times to re install node and npm and re doing the Firebase CLI procedure but nothing seems to solve this problem, I still receive this Error when deploying.
The log error I receive is this :
textPayload: "ERROR: error fetching storage source: generic::unknown: retry budget exhausted (3 attempts): fetching gcs source: unpacking source from gcs: source fetch container exited with non-zero status: 1"
As suggested by this link provided by #Muthu Thavamani :
GCP Cloud Function - ERROR fetching storage source during build/deploy
Firebase CLI uses NodeJS version 12 while on my device I had version 15 installed.
Just use this guide to downgrade your version of NodeJS and everything works fine.
For me, it was because I was using an older version of Firebase CLI.
So I ran the upgrade command as suggested, and it worked.
sudo npm i -g firebase-tools
(My Node version is v15.6.0)
I had a similar problem and wasn't solved by changing node version. What I had to do is actually enter Container Repos and delete both worker & cache images. Then I got it running (using node v12.22.1 and npm v6.14.12).
It's much easier to find and fix issue by examining the actual logs by using this command to open the log
firebase functions:log
The specific issue will be visible there. I sometimes had error as simple as a missing packages in package.json
I wish they could show better info on the errors directly. but at least we can find them here.

Jest test suite fails to run on Circleci

I have set my Circleci container in Ubuntu 14.04, and my node version is 6.11.2. I have written a basic test case using Jest.It works perfectly in my local environment, the test suit runs and the test case passes. However, when I am trying to deploy it using Circleci, the build fails as the test suite fails to execute. Here's the error circleci is throwing-
FAIL test/index.test.js
● Test suite failed to run
SyntaxError: Unexpected token {
at _load_jsdom (node_modules/jest-environment-jsdom/build/index.js:17:41)
I can't figure out where the error actually is since it executes perfectly in my local environment. I have used the same node version in my circleci build as well.
Make sure the docker image has exactly the same node version as your local environment. E.g.
docker:
- image: circleci/node:8.9.4

Why when test fails jenkins still says success?

I have a MEAN project. Using Jenkins on an EC2 machine I build this using the following shell script:
npm install && PORT=8888 npm test
mocha returns 2 (number of failing tests) but still jenkins says:
Finished: SUCCESS.
If tests are failing I expect to see
Finished: FAILURE
Do you know why its not working fine?
You can:
Use a test runner like Karma, or
Tell Mocha to report in, for example, XUnit format, by passing Mocha the --reporter xunit flag. XUnit closely aligns with JUnit which Jenkins understands, or
Add in a custom reporter — mocha-jenkins-reporter is a decent option.
In the end I used a different solution: installed Jenkins Text Finder and if "expected - actual" is found in log (test failed), I let this plugin to mark the build as "Unstable".

Resources