Skip to content

Instantly share code, notes, and snippets.

View prashanth-sams's full-sized avatar
🍎
Each day is interesting!!!

Prashanth Sams prashanth-sams

🍎
Each day is interesting!!!
View GitHub Profile
@prashanth-sams
prashanth-sams / dashboard.json
Last active March 1, 2020 10:46
DataDog Automation Dashboard
{
"title":"QA Dashboard",
"description":"",
"widgets":[
{
"id":0,
"definition":{
"type":"timeseries",
"requests":[
{
@prashanth-sams
prashanth-sams / test.feature
Created February 29, 2020 13:16
Sample Cucumber test
Feature: Google search
Background: Google Home page
Given I navigate to Google home page
Scenario: C845 Verify Google Home Page
Then I verify the Google home page
Scenario: C847 C850 Verify Google Home Page x2
Then I fail to load Google home page
@prashanth-sams
prashanth-sams / hooks.rb
Created February 29, 2020 13:12
Export Ruby automation results to DataDog - Cucumber
Before do |scenario|
$dd_data ||= []
$dd_passed = $dd_failed = $dd_pending = 0
end
After do |scenario|
if $dd_data
case scenario.status
when :failed
status_id = 0
@prashanth-sams
prashanth-sams / spec_helper.rb
Created February 29, 2020 12:37
Export Ruby automation results to DataDog - RSpec
RSpec.configure do |config|
$data ||= []
$passed = $failed = $pending = 0
config.after(:each) do |scenario|
if (scenario.exception) && (!scenario.exception.message.include? 'pending')
status_id = 0
elsif scenario.skipped?
status_id = 2
elsif scenario.pending?
@prashanth-sams
prashanth-sams / config.sh
Last active February 24, 2020 15:16
DataDog in EC2
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
@prashanth-sams
prashanth-sams / test_spec.rb
Created February 23, 2020 11:51
Dummy spec
describe 'status validation', :focus do
it "boolean validator", :get do
expect(200).to eq(200)
end
it "boolean validator x2", :get do
expect(200).to eq(201)
end
@prashanth-sams
prashanth-sams / spec_helper.rb
Last active February 23, 2020 11:38
Ruby Client Exporter for Prometheus server
RSpec.configure do |config|
config.before(:all) do
@prometheus = Prometheus::Client.registry
@http_requests = Prometheus::Client::Counter.new(:website_baseline, docstring: 'desktop tests', labels: [:passed, :failed, :pending])
@prometheus.register(@http_requests)
$data ||= []
$passed = 0
$failed ||= 0
$pending ||= 0
end
@prashanth-sams
prashanth-sams / create_ec2_machine.tf
Created January 22, 2020 15:06
Basic terraform script to create a EC2 instance
provider "aws" {
version = "~> 2.0"
region = "us-west-2"
shared_credentials_file = "~/.aws/credentials"
profile = "prashanth"
}
data "aws_ami" "amazon-linux-2" {
most_recent = true
owners = ["amazon"]
@prashanth-sams
prashanth-sams / helm3_chart_cheatsheet.md
Last active January 26, 2020 22:17
Helm3 Chart Cheatsheet

helm3 version

helm3 version

install helm chart

helm3 install <chart-name> <chart-location>
helm3 install grafana .
helm3 install grafana . --namespace <namespace>
pip install ansible