How to build and run JFR test example present in opentelemetry sdk-extension - open-telemetry

I want to build and run sdk extension jfr-events. there is a test example in the opentelemetry repo(https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/jfr-events)..can someone please provide me the steps to build and run the example and how to showcase JFR events in JMC in OTEL format as mentioned in the above github repo ?

Related

Where can I find updated source code for Jorge Acetozi book "Continuous Delivery for Java Apps: Kubernetes and Jenkins in Practice"

I just started reading the Jorge Acetozi book "Continuous Delivery for Java Apps: Kubernetes and Jenkins in Practice".
For the code examples I use the source code in his github repository:
https://github.com/jorgeacetozi
Unfortunately this code doesn't work for Java 11 and uses old Spring Boot 1.5 version
Also Jenkins, Selenium, Kubernetes and Vagrant tools, described in the book, use very old versions.
Has anyone finished this book lately, could you please, provide the updated source code for this book?
Unfortunately, the old source code, prevents me from learning further.
I have managed to finish this book, but did a lot of changes to the source code:
https://github.com/skyglass/notepad - updated source code for Notepad Spring Boot application.
Spring Boot has been updated to version 2.4.2.
I had to make lots of changes to the front-end code, to make styles displayed correctly with the latest version of Thymeleaf library.
Also did some other changes, related to update from Java8 to Java11.
All maven dependencies have been updated to the latest versions
https://github.com/skyglass/jenkins-kubernetes-cd - This repository corresponds to Jorge Acetozi's "ebook-continuous-delivery-with-kubernetes-and-jenkins" repository.
"docker-images" folder contain "jenkins", "kubectl" and "maven-jdk11-git" docker image files, which are used by Jenkins pipelines
Kubernetes yaml files have been updated to the latest version of Kubernetes
Unfortunately, I couldn't manage to make acceptance tests working for "Firefox" browser, with the latest "Selenium Grid" docker images. Therefore, acceptance-tests pipeline code only contains tests with "Chrome" browser
All Jenkins files have been updated to use the latest docker images, or custom docker images, published by me in Skyglass Docker Hub. Feel free to publish them in your own docker hub, using docker files from "docker-images" folder.
"docker-images" folder contains custom docker image to run Jenkins. I recommend using this image to run Jenkins on your computer. It uses the latest version of jenkins for jdk11 and all needed plugins with the latest versions
https://github.com/skyglass/notepad-performance-tests - the performance tests have been updated for the latest versions of Scala, SBT and Gatling.
https://tferdinand.net/en/create-a-local-kubernetes-cluster-with-vagrant/
https://www.exxactcorp.com/blog/HPC/building-a-kubernetes-cluster-using-vagrant
These articles will help you to install Kubernetes Cluster locally, with Vagrant and VirtualBox.
Of course, I also used lot of other online resources. StackOverflow helped me a lot. :)
Have fun reading this book, hope these examples help you get the best learning experience.
Thank you, Jorge Acetozi, for this wonderful book!

how to update active build in google cloud services?

The project I'm working on uses Google Cloud Services with Firebase. We have some services that run on Google Cloud Run. I cloned a Golang repo and made a small modification to a struct which is a dependency for couple of the Cloud Function Triggers.
I am attempting to get this new code running on the cloud but seem to be missing something. I did the following command:
gcloud builds submit --config ./cloudbuild.yaml .
which completed successfully. I now have that build showing in Google Cloud Builds, however I am unsure of how to make that the active build.
Where do I set this build to be the active build?
You don't need to worry about activating it. Once you run the command gcloud builds submit, you have already created the build and it's active in your builds. So, you don't have to set this build as the active build or anything like that, as it's already in your platforms. This works like this as you can have many active builds in your platform.
In case you want to check your build details, you can access your Cloud Build page, select your project and click Open. Once there, just click on a particular build so you will see the Build details page. To view the artifacts of your build, under Build Summary, click Build Artifacts.
In addition to that, if you have more doubts in general on how to use Cloud Build and how it works, this tutorial Serverless CI/CD —Cloud Build has all the details about it.

how to set up a Appium UI test maven project to work with Gitlab CI to test Android App?

I am an intern now, new to automation test.My goal here is to help my company set up CI for client side.
Right now I have a maven project contains several tests using Appium java-client lib, under Eclipse IDE, which could run the UI tests locally. My goal next step is to hook my tests with the gitlab repo(which is already there, created by the android developers), but I am stuck here. Could somebody help me out?
Please try to be specific:
how should I set up the .gitlab.yaml?
can we just have the script in yaml to download Appium and maven?
or we could just download Appium, but import all the Appium java-client jars to libs in main?
If either of above is true, how? if neither, what and how should I
do?
Where should I put my test in gitlab in that repo? Or I don't have to
put my tests in the existing repo. Instead, I could have another one
and tell yaml where to reach? Again, how?
It will be helpful if you could help me go through the workflow.
Like, when I developers check in code, gitlab read the yaml, then
build, then find my test suits in where(Q3), then execute etc.
Many thanks in advance!
Since finally someone is also interested in this question, let me share my solution to this.
So, if you are looking at this question, I assume you already have your test suite and you could test it locally in your machine, either have your app installed in a simulator or a real device. Now you need to read more about gitlab pipeline and gitlab CI :
pipeline: https://docs.gitlab.com/ee/ci/pipelines.html
gitlab CI: https://docs.gitlab.com/ee/ci/quick_start/
And you should have noticed that, one of the advantages of Appium is that you don't need to change a thing about the App you are testing, you are testing exactly the same App which is going into production. To learn more about Apppium:
http://appium.io/docs/en/about-appium/intro/
Now, to run the automation test, you need your test suite, the app, and Appium server. What we need to do is adding another stage in .gitlab-ci.yml, tell it to
take the newly compiled App, compile your test suite
install the App in simulator/real device
compile your test suite and run it.
To make things easier to understand, we start with question 4, workflow:
So when the code is checked in to gitlab, the gitlab runner runs the jobs of each stage in your .gitlab-ci.yml, and when it runs to your stage, it does the automation test, and note that it is running on your server, so it means you need to have Appium installed on your server and have it up and running when try to run your automation test suite. Now the problem is that, is your server capable to do so? If you wanna do the automation test in your server, you need to install Appium on it, simulator probably(and which might need your server to equip with GPU), etc, these are the concerns of maintaining server. The alternative would be using the third-party service ,which is what I did. Turns out our(when I was in that company) server isn't capable of running automation UI test, so we turned to AWS-ADF(Amazon Device Farm), there are many other service providers you could choose, see the link for references:
https://adtmag.com/blogs/dev-watch/2017/05/device-clouds.aspx
So I basically have a python script in my functional test stage, and it will grab the newly complied App, the automation test suite, upload them to AWS ADF, and then schedule a run, yields result when the run is finished.
so, to answer question 1:
we need to create one more stage for our functional test in .gitlab.yaml, in my case, I have a stage functionalTest_project stage after the stage which compiles the Android App. And then you script the necessary cmd in your stage, or if its too lengthy, your script in another file(put it in your repo) and then execute it. In my case, I put my script in python_ci.py, and then I execute it in my stage use “python python_ci.py” .(here you need a docker with these requirement, see below too)
You don’t download Appium, you set up Appium on your or if you use a cloud service, that service should set up Appium for you.
What I did it is that I use maven built and package the test suite locally and then push it to gitlab repo, which now I believe the better way would be compile and package it in the your functionalTest stage in .gitlab.yml. now it comes back to first point of question 1, how to get maven, my understanding is that its a dependency of the server, like python, so they could both be obtained by telling gitlab to execute your script with a docker that has python and maven dependency.
answer to question 3:
put it in the same repo, but out of the Android project(i.e. they will under the same directory).
how to tell yml to reach the test suite? remember they are in the same server, so you could the relative path in your yml script to tell yml where to get your test suite.
Hope this helps!

Seeing TestNG progress in TeamCity

We are running selenium tests using TestNG in TeamCity.
Is there a way to know the progress of the current run beyond the progress bar and build log?
Information of interest is:
Which tests were run and passed
Which tests were run and failed
...
Thx
As I know testng plugin for teamcity does not have such option. You can try real-time reporter e.g. extentreports. It could be easily connected via testng listener and pass results to report server.
Here is a link to another question which I answered recently which addresses something similar to what you're looking for with ExtentReports.
ITestListener - ExtentReport
TeamCity can report the tests in a build and you should really get that in order to use TeamCity at full power. It can list the test failures in a build with details, display test history, you can assign investigations of a test to your team members or mute the test failures...
If you use TeamCity's Ant or Maven build steps, TestNG tasks should be recognized automatically and build status should turn into something like "Tests failed:​ 1 (1 new),​ passed:​ 301".
Otherwise try to generate XML report in one of supported format and use XML Report build feature in TeamCity.
Yet another alternative is to report the tests in a completely custom way through TeamCity service messages.
All these approaches should update TeamCity build status and details as soon as the test is reported by the build tool. For service messages this is as soon as a test finish is reported, for Ant this is after each test run, for Maven this is after finishing tests of a module and for the XML test report build feature, this is while the XML is being saved on disk, even in incomplete form.
If you are rather looking for a specific test progress, that can be seen in the build log or you can notify TeamCity about stages in the build from within the test/script.

Collect Maven Build metrics like time taken, whether build is success or not

I want to collect the build metrics for a maven build (metrics like total time taken for the build, status of build SUCCESS or FAILURE, test results etc.,) and store it for analysis. All these information are available in the log but i need to collect it at the end of the build and call a service with the data.
This feature should be available where ever maven build is done. so it should be associated with the lifecycle. But i am not sure whether maven has any hooks to tap to get this kind of information.
-
Kamal
You might want to look into Continuous Integration, which will build your project everytime you commit to the repository. I personally like Jenkins, where you can install the Global Build Stats Plugin which I think will cover what you want to do
I found a way to profile the maven build in developer machines.
For Maven 3 and above, it exposes the events through EventSpy API. An example profiler is available at https://github.com/tesla/tesla-profiler . so we implemented our own profiler and it logs the data to the central server.
For Maven 2.x, there is no easy way. I modified Maven to expose the events and wrote listener to track the data
#Kamal's answer requires you to modify your local Maven installation which is not a portable solution.
Here is a maven plugin which collects execution times of each plugin and saves it as an HTML report. The plugin utilizes Maven's core extensions feature which was introduced in 2015, so that you don't have to modify your Maven installation.
https://github.com/jcgay/maven-profiler

Resources