How do I test a concourse custom resource type? - concourse

So I have build my own custom resourse type. As, suggested in this link.
I want to know how to test this docker image? How would I get the docker running?
What would be the command? Would I have to pass additional build parameters?
Is there a particular way custom resource types are tested?
Please provide me all the information.
(thanks in advance)

Most concourse resources get tested like this- you write some test that run the binary, with json piped in over stdin, and then you check the return code and the output.
You can run those tests standalone, or run them as a part of the build process- so just docker build . to re-test.

Related

Get experiment name from within a Kubeflow pipeline run

I just started working with Kubeflow and I ran into a problem. I need my pipeline to be able to automatically get the name of the experiment it belongs to. I tried to use the kfp package but it seems to me that there is no way to get the experiment name of the current run. Do you have any suggestions? Thank you very much!
A run is tied to a experiment, not the other way around. When you run a pipeline you specify the experiement name with kfp.Client.run_pipeline as argument. When you do not specify an experiment then it will automatically be tied to the default experiment on AI platforms.
So you won't need to get the experiment name since you specify the experiment when running a pipeline.

Can NUnit console runner pass some command line arguments to nunit-agent?

We use the NUnit console to run our tests in Jenkins and we have many projects that share some tests. We want to be able to run the tests concurrently and to do that we need the tests to look at different databases.
I would like to pass in the project name to the nunit-agent which wouldn't know how to use it, but we would be able to fetch that from the command line arguments running the test and decide which database to look at.
I am open to suggestions.
We currently use "C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" Path\Tests.dll --result=nunit-result1.xml to run the tests
nunit-agent uses arguments to pass information that NUnit needs. For passing information to the test, the standard way is to use the --params command-line option and then access the values from your tests by means of TestContext.Parameters.

Build code in vscode using external http server

Our code building process is done via an http server which starts the build process after receiving a project uuid from the build command. Once the server starts the compilation, GCC compatible output can be fetched from it.
Note: only my extension is aware of the project uuid which is different per workspace.
AFAIU I can implement it by:
programmatically adding a task which will call a script with the correct workspace uuid. Is this possible?
Having my extension manage the build process. This seems to be far from supported.
Bottom line, I'm trying to avoid asking the user to add anything to the configuration files and I want to completely manage the build process.
Thanks!
As I didn't find a suitable only vscode solution I did the following:
Defined a helper script which I executed as the task. The helper script was respojnsible for the communication against the HTTP server.
I registered the task using vscode.workspace.registerTaskProvider API, and made sure to register it only after figuring out the UUID.
Then in the task itself I executed the helper script.
(A nice task register example can be found here: https://github.com/Microsoft/vscode-extension-samples/tree/master/task-provider-sample)

How to run system command in Cake build?

I couldn't find any information related with running custom system command on this site: cakebuild.net/dsl
How can I do it?
The real command I want to run is 'upx mproject.exe'
If I have understood you correctly, then what you are looking for is the Process Aliases that exist within Cake:
http://cakebuild.net/dsl/process/
These allow you to start any arbitrary process from within your Cake script.
Another option, would be to create a Cake Addin that wraps the tool that you are trying to execute.

Jacoco code coverage for remote machine

I tried to find this answer but hardly found it anywhere. I am doing the API testing, In process I need to call the rest API from my local machine. local machine contains the maven project and a framework to call respective rest API.
I need to check the code coverage of remote Rest API and form a report based on the code coverage. please help, how to do that?
Note: I found this link useful but it does not elaborate clearly on what to do?
http://eclemma.org/jacoco/trunk/doc/agent.html
you will probably do a bit of file copying around - depending on the way you run the tests.
JaCoCo runs as a java agent. So you usually add the javaagent parameter as mentioned in the docs you linked to the start script of you application server.
-javaagent:[yourpath/]jacocoagent.jar=[option1]=[value1],[option2]=[value2]
so it would look like:
java -javaagent: -jar myjar.jar
Using tomcat you can add the "-javaagent" part into JAVA_OPTS or CATALINA_OPTS environment variables. Should be similar for other servers.
this will create the jacoco*.exec files. you need to copy those back to your build or CI server to show its results (for ex if you use sonar you need those files before running the sonar reporter). Its important to just include the packages you're interested in.
You can also create one jacoco.exec file per test flavour (jacoco.exec for unit tests, jacoco-it.exec for integration tests, jacoco-at.exec for application tests).
And I would not mix coverage with performance testing - just to mention that too.
There are some examples on stackoverflow for JBoss