Running tests with 'ng e2e' is throwing 'Invalid host header' - javascript

I am executing protractor tests by executing ng e2e command, after running server on Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/
Then tests executes on localhost:4200 successfully, but when url changes to 'http://demo-qa.companyname.com:4200/' in 'protractor protractor.conf.js' as baseUrl, test failing while hitting the url with error 'Invalid Host error'
The same url when I type manually on browser it is working though. Not sure what I am missing,
I had also tried by providing protractor config parameter to pick config file after ng e2e command, final command looks like ng e2e --protractorConfig=e2e/protractor.conf.js , yet no luck. Any suggestions, on what I am missing.?

Related

Run Cypress without checking localhost for running web server

In addition to web based e2e tests, I am using Cypress to assert some graphql responses are correct.
However if I just try to run those tests on their own, with the web server not running, then Cypress complains with the following message;
Cypress could not verify that this server is running:
http://localhost:3000
This server has been configured as your baseUrl, and tests will likely fail if it is not running.
Is it possible to run Cypress in a mode that doesn't check this server first?

Gitlab Runner - listen_address not defined

I am setting up gitlab-runner locally on my mac to be able to run build and test scripts using docker. I have gone through the installation instructions listed on the Gitlab runners page to install the runner locally:
# Download the binary for your system
sudo curl --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64
# Give it permissions to execute
sudo chmod +x /usr/local/bin/gitlab-runner
# The rest of commands execute as the user who will run the Runner
# Register the Runner (steps below), then run
cd ~
gitlab-runner install
gitlab-runner start
From what I can tell it is installed fine. I then registered a runner like so:
sudo gitlab-runner register --url https://gitlab.com/ --registration-token $REGISTRATION_TOKEN
(I obviously replaced $REGISTRATION_TOKEN with my token). When it prompts me for additional details I have entered the following:
Tags: (I left this blank)
Enter an executor: docker
Enter the default docker image: node:14.0.0
I then get the following message:
Runner registered successfully. Feel free to start it, but if it's
running already the config should be automatically reloaded!
When I then navigate to the root of my project I try and run gitlab-runner run but I get the following error:
Starting multi-runner from /Users/ben/.gitlab-runner/config.toml... builds=0
WARNING: Running in user-mode.
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
Configuration loaded builds=0
listen_address not defined, metrics & debug endpoints disabled builds=0
[session_server].listen_address not defined, session endpoints disabled builds=0
^CWARNING: [runWait] received stop signal builds=0 stop-signal=interrupt
WARNING: Graceful shutdown not finished properly builds=0 error=received stop signal: interrupt
WARNING: Starting forceful shutdown StopSignal=interrupt builds=0
All workers stopped. Can exit now builds=0
When I look at the config.toml if looks like it may be missing some configuration in there as the error above may suggest? Here is a cat of the entire file:
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
I'm not sure why i'm receiving this error message? Does my config look alright? When searching the issue I found another thread that said to just set "Can run untagged jobs" to yes which I have done but it still does not work...
It makes sense that you're having problems with the configuration.
If you read carefully the output, it says that you're running in user-mode, so I suppose you started the runner by using gitlab-runner.
Problem is that you registered your runner using sudo, so you configured the system-mode under /etc/gitlab-runner/. This configuration is loaded when you start gitlab-runner with sudo.
In order to verify that, you will be able to see the registered configuration under /etc/gitlab-runner/, with all the additional sections regarding Docker Runners and so on, instead of the basic configuration that you have under ~/.gitlab-runner/ which I suppose is the one you attached to your question.

Why am I getting an error when trying to run a new react native project

I have created a new react native project by running "react-native init MyFirstProject". I have also installed node and have added no code of my own to any of the files.
I have tried to run the project to make sure it works by running "react-native run-ios --simulator="iPhone 8"". The command runs successfully but I am given the following error.
Could not connect to development server.
Ensure the following:
Node server is running and available on the same network - run 'npm start' from react-native root
Node server URL is correctly set in AppDelegate
WiFi is enabled and connected to the same network as the Node Server
URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
Blockquote
GSEventRunModal
UIApplicationMain
main
start
How do I fix this error?
Try opening your project ios/MyFirstProject/MyFirstProject.xcworkspace and see if there's any build error.
I ran into this problem too, with the same error:
RCTFatal __28-[RCTCxxBridge handleError:]_block_invoke
It turned out that I had another server running on my local machine on the same port that the expo development client server was running (:8081), and that it was taking priority and then obviously giving the client a very different response to what it was expecting. Quitting the other server fixed the problem.

Node.JS: Why is my connection to localhost:3000 refused?

I'm a student going into back-end development for the first time and are trying to learn Node.JS. I downloaded a pdf book about Node.JS from sitepoint called: "Jumpstart Node.JS". In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000, i got nothing except the following message: "Connection refused: localhost:3000", Can somebody please tell me what might have went wrong and how to fix it?
Edit1:
The instructions i followed is about setting up a node.js server using the Node command line, thus no code, simply cmd commands, however, here is a quick summary of the process i followed:
Created an account on MongoLabs and then a database using the free pricing plan.
Installed express using the command: npm install -g express#.2.5.8.
Created an applications with default options using this command: express authentication.
modified the package.json file in system32
installed the dependencies by typing cd authentication, hitting enter, and then typing the command: npm install
Typed node app and hit enter.
According to the instructions i should have seen a message: "Welcome to express" but instead got the error message.
In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000
It seems that you didn't start the server.
Somewhere between installing the dependencies and navigating to the URL you need to actually start the server if you want it to serve the request.
Check that there is no copy of the server running in the background, or that another app is using the port currently.
(Your firewall show allow you to see which app has been allocated to that port)
Because nodejs requires it to be the only app on that port running on your computer.
Also try a different port maybe?

How to use node-inspector with sails.js?

I would like to debug my sails.js application but I don't know how to launch node-inspector for this occasion.
Normally it would go :
$ node --debug myapp.js
If I run my sails application normally :
$ sails lift --prod
and then launch node-inspector
$ node-inspector --debug-port 1337
Node Inspector v0.7.0-2
info - socket.io started
Visit http://127.0.0.1:8080/debug?port=1337 to start debugging.
I get this error in inspector GUI :
Error: read ECONNRESET. Check there is no other debugger client attached to port 1337.
As of Sails 0.9.8 you can use sailsd to call sails in debug mode, e.g. sailsd lift.
-- Edit --
Looks like this didn't actually make it into 0.9.8, my bad. To make your own debugging command for now, save the following into /usr/local/bin as sailsd (or whatever you like):
#!/bin/sh
node --debug `which sails` $#
-- Edit 2 --
In Sails v0.10.x, you can do sails debug instead of sails lift to start Sails in debug mode!
Correct me if im wrong but, you cant use debug port 1337 if sails lifts on port 1337.
try specifying a different port.
node --debug app.js
#this will lift sails on port 1337 and the default debug port i think its 5858
#start node-inspector, once it starts hit enter to put it into background
node-inspector &;
#visit http://127.0.0.1:8080/debug?port=5858
edit just confirmed this method works, instead of using sails lift you're using node to start app.js in debug mode. the node-inspector web runs on port 8080 and the debugger links on port 5858 by default.

Categories

Resources