How can I run protractor e2e tests on skeleton-esnext-webpack without building the app? - protractor

I've been using the skeleton navigation skeleton-esnext-webpack environment to run local tests on aurelia. However, sometimes I need to run my tests from a server already set up on the web. I'd like to keep the aurelia plugins intact but not wait so long for the local build to be built and ran since I already have it running elsewhere. The readme doesn't say much about how everything works.
Is there a way to temporarily run my tests while ignoring the local build and setup?

Go the package.json file in the root and modify it as so:
"e2e": "concurrently --success first --kill-others \"npm run e2e:start\"",
You can even keep the original and rename it something else and have that as a local call and rename the above line to run it without building it.

Related

Bazel not running flutter correctly

I'm trying to execute a flutter command using bazel. This is my BUILD.bazel file:
genrule(
name = "flutter_build",
srcs = [
"//:root_filegroup"
],
outs = ["out.txt"],
cmd = "flutter build ipa --export-method development"
)
The command flutter build ipa --export-method development works perfectly if I run it directly in my iterm, but for some reason the same command in bazel returns a permission error:
Flutter failed to open a file at "/Users/rlanhe/tools/flutter/flutter/bin/cache/lockfile".
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
Try running:
sudo chown -R $(whoami) /Users/rlanhe/tools/flutter/flutter/bin/cache/lockfile
Well, doesn't make sense to me, since that folder already have correct permission and I'm able to run the command outside bazel.
Integrating Flutter/Dart and Bazel is likely a large amount of work.
There's an issue here about it:
https://github.com/flutter/flutter/issues/19680
And it looks like there are some dart rules here:
https://github.com/cbracken/rules_dart
The immediate issue you're running into is that Bazel runs each action (i.e. build step) in a sandbox, so unless an input to the action is declared, it's not going to be in the sandbox. You can maybe get further by adding tags = ["no-sandbox"] to the genrule, (see https://bazel.build/reference/be/common-definitions#common.tags).
This is essentially running one build system inside another, and this isn't going get the caching and incrementality benefits of Bazel, because Bazel has no insight into what happens inside the genrule. Unless you have some higher-level plans to integrate this into a larger repository that uses Bazel, there isn't much benefit here compared to running flutter directly or in a shell script.

Running mapbox-gl-js locally (unable to serve debug page)

Edit:
Summary, I tried to follow only the steps listed in the below two links as applies to windows:
https://github.com/mapbox/mapbox-gl-js/blob/master/CONTRIBUTING.md
https://github.com/stackgl/headless-gl#windows
Here I have reattached the screenshot of the commands that I had problems with:
https://imgur.com/RCQCNU5
One more step I took that I should mention is I also did not find the headless gl when I downloaded the repository, when the install headless gl command did not work I manually copied the file and put it in my local copy under the nodemodules directory thinking it would work but it didnt solve anything. I do think this is related to access issues but I dont know what else I should try to get it working?
First, let's clarify your problem: you want a version of mapbox-gl.js which contains a recently fixed bug.
Your best option is to just wait a couple of weeks for a release.
Failing that, you should build your own, from master. You don't need to set up a debug server for that. You can skip straight to the "Creating a Standalone Build" section.
If the steps for building on Windows don't work for some reason, you could set up a local virtual machine running Ubuntu and use that.
But honestly, just wait a couple of weeks. :)
Just in case some one else need to run this on local server.
After clone
Run npm install
npm run start-debug
It will start listening on port 9966.
Test the debug html files entering to
localhost:9966/debug/FILE_NAME_TO_TEST.html

Run Karma tests only on file change

Is it possible disable the initial execution of the karma test suite such that it is only executed when a watched file changes?
The problem with the initial run in my case is the following.
I am using the jspm development bundling which watches the files included inside the bundle for changes and incrementally rebuilds the bundle if such a change event is emitted.
Since this process runs forever, I cannot wait for it's termination and then launch Karma.
So I'm launching Karma and the bundling in parallel which works great except the initial run where no bundle exists or the bundle potentially contains old sources.
You can try using grunt watch task. It will watch the changes and run the test.
You can search for boilerplate as well.
I just created the npm module called wait-for-change.
Now I can use it inside the package.json like this:
{
"scripts": {
"test": "wait-for-change my-bundle.js && karma start"
},
"devDependencies": {
"wait-for-change": "^1.0.1"
}
}
This works pretty well for me.

Having sbt to re-run on file changes - The `~ compile` equivalent for `run`

I know it's possible to re-compile or re-run tests on file changes. I want know to if it's possible to perform something similar for the run command. ~ run does not work. (That makes sense since the run never finishes).
Is there a way to create a task that watches for file changes, quit the running server and relaunch it ?
If not what other tool, would you suggest to get the same behaviour ?
You will have to bring in an external project like sbt-revolver
https://github.com/spray/sbt-revolver

End to end/integration testing - jenkins build

I am currently in a process of setting up Jenkins-CI for my Scala/Akka project.
I managed to create build that is integrated with BitBucket and executes builds when new pull reuqest is created/old pull request is updated.
As a testing framework we are using Specs2 which is also integrated with Jenkins by using JUnit post-build action. Now I am wondering how to properly execute e2e tests in my build.
Basically in git repository we have 2 projects, lets call them main-project and rest-tests. rest-tests contains e2e tests that are written using REST-assured library. To execute them I need to start main-project application (which uses Spray library to set up HTTP server) and then execute test task in sbt project of rest-test.
My idea was to execute main-project startup script (generated by sbt-native-packager) whith something like this:
$WORKSPACE/main-project/target/universal/stage/bin/main-project & echo $! > /tmp/main-project.pid
then execute test task of rest-tests project and finally kill process with PID that is saved in /tmp/main-project.pid file.
The last step should be implemented using https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task because if some rest-testswill fail the next steps of build will not be executed (or at least that is what I am thinking) and I could end with my instance of application running after the build is finished.
This is first time when I am setting up CI system and my solution seems to be a little hacky (at least to me). I am wondering if there is a better/more idiomatic way of solving my problem of running e2e tests which require another application running.