Clean DB with npx commands in Cypress - database

I would like to clear the database of an application that I am testing using Cypress using npx commands, but when running the test I get the following error:
"Error: Cypress Error: cy.exec('npx sequelize db:migrate:undo:all') failed because the command exited with a non-zero code.
Pass {failOnNonZeroExit: false} to ignore exit code failures.
Information about the failure:
Code: 1
Stderr:
(node:20068) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trac..."
I would like to clear the database of an application that I am testing using Cypress, I know that the commands are:
`Cypress.Commands.add("cleanDB", () => {
//cy.exec('set NODE_TLS_REJECT_UNAUTHORIZED=0')
cy.exec('npx sequelize db:migrate:undo:all')
cy.exec('npx sequelize db:migrate')
cy.exec('npx sequelize-cli db:seed:all')
//cy.exec('set NODE_TLS_REJECT_UNAUTHORIZED=1')
})`
to clear and run the migrations, I have already tried to change the error variable to 0, I ran Cypress as an administrator, used a .exec command parameter to run the command in the folder where the api is running but nothing works.

Related

Ionic build failed without specific error

After cloning my Ionic React project to my server, I ran npm install and all dependencies were installed as expected.
But when I tried to build my app running sudo ionic build --verbose, it tooks much more time than usual and ended like this :
eslint:lint-result-cache Persisting cached results: /var/www/html/ms-users-front/node_modules/.cache/.eslintcache +0ms
eslint:cli-engine Linting complete in: 4827ms +48ms
//It stay here for at least 10min before to failed while it tooks 1min in my local machine.
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
[ERROR] An error occurred while running subprocess react-scripts.
react-scripts build exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 1 functions +1ms
ionic:utils-process processExit: exiting (exit code: 1) +44ms
My server is an ec2 instance with httpd installed and everything was working great before I tried to build a new version yesterday.
With exactly the same process, the app is building perfectly on my local machine...
I tried npm update, delete eslint cache, and build but without success.
I tried to downgrade Typescript to 4.1 because I had a warning saying that Typescript should be >4.5 and it was 4.7. But after some tests on local, it looks like this has no incidence on the build process.
I'm totally stuck and I absolutly don't know what to try.

Github deploying issues

When I try to use npm run deploy on github, it throws me the following errors:
fatal: bad object refs/remotes/origin/main
error: github.com:Aris-Empanta/Accountant_landing_page.git did not send all necessary objects
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
error: bad ref for .git/logs/refs/remotes/origin/main
fatal: bad object refs/remotes/origin/main
fatal: failed to run repack
error: task 'gc' failed
Any suggestions?
Though VS code command line, everytime I change my project I push the changes you know, git add, git commit, git push origin. After that when I confirm the merging from github, I write npm run deploy to deploy the changed project to gh-pages. It was working, but suddenly stopped.

Deploy error An unexpected error occurred: "ESOCKETTIMEDOUT". App Service Azure

I have a big problem trying to deploy a react app to a azure app service with visual studio azure app service extension, im getting this error
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.27.tgz: ESOCKETTIMEDOUT".
Im using yarn and i read that increase the network timeout maybe solve this. But how i can do it?
I am using yarn and i read that increase the network timeout maybe
solve this. But how i can do it?
You can try running it in your terminal :
$ yarn install --network-timeout 1000000
And also try to clear the cache by running the below cmd
$ yarn cache clean
$ yarn // to install dependencies, no need for "yarn install"
Please refer the below links for more information:
.yarn is having troubles with the network connection | SO THREAD .
. React deployment keeps failing with ESOCKETTIMEDOUT | MS Q&A
Try to NOT run build on Azure. Do this by answering NO when you publish.
Have you already made the settings to build on Azure (answered yes) .. undo by deleting the following files
.vscode\settings.json
.deployment
Create the file .yarnrc, and write into file:
network-timeout 1000000
Save file & deploy your app with the file

Azure DevOps ionic Error building android

While running Azure DevOps tasks for cordova to build android getting following error, but the same code build fine in local machine!
[ERROR] An error occurred while running subprocess cordova.
cordova platform add android#8.0.0 --verbose exited with exit code 1.
Even including --verbose doesnt give any more insights into whats went wrong! Any clues on resolving this?
Log :
2020-06-10T12:07:08.9595670Z Updating icons at platforms/android/app/src/main/res
2020-06-10T12:07:08.9595970Z Updating splash screens at platforms/android/app/src/main/res
2020-06-10T12:07:08.9596290Z This app does not have additional resource files defined
2020-06-10T12:07:08.9596560Z Prepared android project successfully
2020-06-10T12:07:08.9597390Z Executing script found in plugin cordova-plugin-add-swift-support for hook "after_prepare": plugins/cordova-plugin-add-swift-support/add-swift-support.js
2020-06-10T12:07:08.9597890Z Resolving module name for glob => glob
2020-06-10T12:07:08.9598130Z Saving android#8.0.0 into platforms.json
2020-06-10T12:07:08.9598640Z --save flag or autosave detected
2020-06-10T12:07:08.9598910Z Saving android#~8.0.0 into config.xml file ...
2020-06-10T12:07:08.9599200Z adding android to cordova.platforms array in package.json
2020-06-10T12:07:08.9599480Z No scripts found for hook "after_platform_add".
2020-06-10T12:07:08.9599780Z [ERROR] An error occurred while running subprocess cordova.
2020-06-10T12:07:08.9600000Z
2020-06-10T12:07:08.9600570Z cordova platform add android#8.0.0 --verbose exited with exit code 1.
2020-06-10T12:07:08.9600850Z
2020-06-10T12:07:08.9601610Z Re-running this command with the --verbose flag may provide more information.
2020-06-10T12:07:08.9602390Z 2020-06-10T12:07:08.134Z ionic:utils-process onBeforeExit handler: 'process.exit' received
2020-06-10T12:07:08.9603200Z 2020-06-10T12:07:08.134Z ionic:utils-process onBeforeExit handler: running 1 functions
2020-06-10T12:07:08.9603970Z 2020-06-10T12:07:08.162Z ionic:utils-process processExit: exiting (exit code: 1)
2020-06-10T12:07:08.9604510Z [0m]

Validating Failed to get test status, error: Failed to get test status: INVALID(TEST_SAME_AS_APP) in Bitrise

I have started Appium server with the below lines of code in script step
#!/bin/bash
set -ex
npm install -g appium
appium &>/dev/null &
In Android Virtual Device testing step, getting the following error message. Is there any way to avoid this error
Validating Failed to get test status, error: Failed to get test status: INVALID(TEST_SAME_AS_APP)
The Virtual Device Testing (Firebase Test Lab) feature requires two separate APKs, one that will be tested and one that will drive the test. You can read more details about the setup here: https://blog.bitrise.io/introducing-solid-and-snappy-virtual-device-testing-for-android
See the Instrumentation section
For Instrumentation tests, you'll need to change your workflow:
Add an extra task assembleDebugAndroidTest in your gradle-runner's gradle task input, so it will be something like: assembleDebug assembleDebugAndroidTest.
Add Virtual Device testing for Android step after your gradle-runner step.
As a minimum, in Virtual Device testing for Android step set Test APK path inputs to your built debug apk (e.g.: ./app/build/outputs/apk/app-debug-androidTest-unaligned.apk) Make sure to configure only one section of the step, which matches your desired test type!
(APK path is exported by the gradle-runner step, and it is set as the default for the step's input, so if you want to use a different APK then don't forget to change the step's input accordingly!)

Resources