Posted on Leave a comment

JMeter Introduction – Load test your website

The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance.

You can download from the official webpage and install it for your system given than you already have Java installed.

For windows installations the only thing that you need to do, will be to run as Administrator the jmeter.bat file.

Then you can access the GUI and perform actions with clicks. In this guide I will demonstrate how you can create an http call on your website and perform a load test on it.

In order to start you will need to add a thread group. Right click on test plan and then click threads and select thread group.

Inside the thread group you can create a HTTP Request action. In order to do that you will select add Sampler and then from the available Samplers you will select the HTTP Request.

ON the HTTP Request you will need to configure the host and also the protocol. As my site is working on https I will use this one along with the port 443.

Additionally you can add a listener on your HTTP Request in order to get the results either with a Graph or with a table. To add the result output you will have to press Listener and then select the one that you want.

The below result will be the aggregate report which will show statistics for the requests.

We can also visualize the results using a Graph result

The most important part of the configuration will be the Thread group options which can be found under Thread Group.

There you can configure the below three important things:

Number of threads: Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.

The ramp-up period is the time JMeter should take to start the total number of threads, the time frame (in seconds) for all requests to start. All the threads specified in the Number of Threads input will start within Ramp-up period. For example 100 threads and 100 seconds ramp-up: each second JMeter will start 1 Thread until all threads are started by the time the 100 seconds are up.

The loop count tells JMeter how many times to repeat your test. If you enter a loop count value of 1, then JMeter will run your test only once. To have JMeter repeatedly run your Test Plan, select the Forever checkbox.

Posted on Leave a comment

Success pipeline state on GitHub with pipeline failure

When your pipeline fails on Azure DevOps and the source code is gathered from GitHub (using a service connection) you will notice a failure icon on the repository because the status of the run from Azure DevOps is reported to GitHub. This is the normal behavior and we want it to work like that.

Lets take as example the below run.

The failure will be visible on the github along with the particular commit.

However sometimes we need to allow tasks fail without reporting a failure state on GitHub. You can do that by using continueOnError keyword. With this functionality you instruct the DevOps platform to allow failure for a particular task or job without stopping the pipeline.

trigger:
- none

pool:
  vmImage: ubuntu-latest

jobs:
- job: job1

  steps:
  - script: this script will fail
    continueOnError: true
    displayName:  task 1

  - task: PowerShell@2
    displayName: task 2
    inputs:
      targetType: 'inline'
      script: |
        Write-Host "Hello World"

This will result on a warning state for your pipeline on Azure DevOps.

This means that the pipeline has been executed successfully but some steps have failed.

Nevertheless the state on GitHub will be success as the pipeline is not in a failed state on Azure DevOps.

Posted on Leave a comment

##[error]Error: An unexpected error occurred while trying to push the package with VstsNuGetPush.exe – You need to have ‘ReadPackages’

When you try to push a nuget package from a DevOps pipeline on Artifacts feed you may face the below error.

##[error]Error: An unexpected error occurred while trying to push the package with VstsNuGetPush.exe. Exit code(1) and error(Error:
Microsoft.VisualStudio.Services.Common.VssServiceException: User 'xxx' lacks permission to complete this action. You need to have 'ReadPackages'

This error could be resolved by editing the settings of the feed.

In more detail under permissions you can find which users or service account can perform actions based on their role.

By default I could locate the Project Collection Build Service (Organization) with the Contributor permissions but did not work. As a solution I removed that and added "Project Name" Build Service (Organization). This is the build service for the project on which I have created the pipeline specifically.

Posted on Leave a comment

Starting template for Azure devops pipeline

The below code can be used as a starter entry point for your DevOps pipelines. It is designed with best practices in mind with stages and jobs in order to isolate different functionalities and make it modular. You can include more stages,jobs,tasks by copy and pasting the code.

trigger:
- none

pool:
  vmImage: ubuntu-latest

stages:
- stage: stage1
  displayName: display name for your stage
  jobs:
  - job: job1
    displayName: display name for job1
    steps:
    - script: echo job1.task1
      displayName: running job1.task1

  - job: job2
    displayName: display name for job2
    steps:
    - script: echo job2.task1
      displayName: running job2.task1

The result is shown below