Skip to content

Instantly share code, notes, and snippets.

View akshayamaldhure's full-sized avatar

Akshay Maldhure akshayamaldhure

View GitHub Profile
@akshayamaldhure
akshayamaldhure / .functional-test-template.yml
Last active February 21, 2023 07:47
CI templates - Demo
.functional_test_template:
variables:
ENV: "integration"
LOCALE: "ID"
UPSTREAM_JOB_NAME: $CI_JOB_NAME
UPSTREAM_BRANCH_NAME: $CI_COMMIT_REF_NAME
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_PIPELINE_URL: $CI_PIPELINE_URL
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
@akshayamaldhure
akshayamaldhure / .gitlab-ci-test.yml
Last active February 21, 2023 05:12
CI configuration for the test project - Demo
# qa/gitlab-ci-test-project.git
variables:
APPLICATION_PROJECT_1_CODE: 39941
stages:
- build_and_publish
- functional_tests
build:
@akshayamaldhure
akshayamaldhure / .gitlab-ci-app.yml
Last active February 21, 2023 05:13
CI config for the application - Demo
# qa/gitlab-ci-app-project.git
stages:
- pre_deploy
- test
- build
- deploy_integration
- functional_test
- deploy_production
- post_deploy
#!/bin/bash
# assumes lazy-connect CLI is installed and initialised on your Mac, but does not work well all the times :/
# pre-requisite: grant Accessibility permission to the Apple Script under System Preferences ->
VPN_NAME="the-name-of-your-vpn-here"
VPN_IP="you-vpn-ip-here" # you can find this out from ifconfig when connected to the VPN, only first three decimal numbers from the IP are needed here.
function close_system_preferences()
{ # closes the System Preferences pane on Mac OS
echo "Closing the System Preferences pane"
@akshayamaldhure
akshayamaldhure / jenkins.py
Last active October 16, 2020 04:06
This is a sample Jenkins client code snippet that helps authenticate Jenkins REST API calls by getting crumb from Jenkins's crumbIssuer using valid credentials.
import os
import requests
class Jenkins:
def __init__(self):
self.api_server_url = "your_jenkins_url_goes_here"
self.username = os.environ["JENKINS_USERNAME"]
self.password = os.environ["JENKINS_PASSWORD"]
@akshayamaldhure
akshayamaldhure / sample_migration_test_suite.py
Last active May 27, 2019 11:19
Data-driven migration testing with REST APIs and Python
import csv
import lemoncheesecake.api as lcc
import requests
from lemoncheesecake.matching import check_that, equal_to
USERS_MIGRATION_CSV = "users.csv"
APP_BASE_URL = "http://my-account-management-system.com/"
USERS_ENDPOINT = "users/"
ACCOUNT_DETAILS_ENDPOINT = "accountdetails/"
@akshayamaldhure
akshayamaldhure / EventStoreParkedEvents.js
Created May 6, 2019 11:04
Node.js mocha test spec to check for Event Store parked events
let request = require('supertest');
let assert = require('chai').assert;
let apiBaseUri = request("http://your.event.store.url:port.number");
describe('Ensure no parked events in the Event Store', function () {
let apiResponse;
let parkedMessageUriList = [];
let subscriptionsEndpoint = '/subscriptions';
@akshayamaldhure
akshayamaldhure / EventStoreInFlightEvents.js
Last active May 6, 2019 10:53
Node.js mocha test spec to check for Event Store in-flight events
let request = require('supertest');
let assert = require('chai').assert;
let apiBaseUri = request("http://your.event.store.url:port.number");
describe('Ensure no in-Flight events in the Event Store', function () {
let subscriptionsEndpoint = '/subscriptions';
it(' Verify the total number of in-flight messages = 0', (done) => {