Showing posts with label DevQa. Show all posts
Showing posts with label DevQa. Show all posts

Thursday, 12 May 2022

Top 50 GIT Common Interview Q&A on Real Time scenarios for SDET - SDE - QAE? GIT real time scenarios to resolve issues

 


.

Pipeline Script Fundamentals

Click Here :   DevOps Related Posts

 Check GIT commands for Interview preparation SET-1:

GIT Interview Question 1 to 11

Check GIT commands for Interview preparation SET-2:

GIT Interview Question 12 to 21

Check GIT commands for Interview preparation SET-3:

GIT Interview Question 21 to 30


41. How to push code to existing remote branch in Github?


Push your branch to the remote repository:
git push -u origin feature_branch_name


42. How do I force git pull to overwrite the local file changes?


Note: If you have local unpushed commits this will remove them from your branch!

First, run a fetch to update all origin/<branch> refs to latest:(downloads the latest from remote without trying to merge or rebase anything)

git fetch --all


Backup your current branch:

git branch backup-master


Then, you have two options:

git reset --hard origin/master

OR If you are on some other branch:

git reset --hard origin/<branch_name>


//git reset resets the master branch to what you just fetched. 

//The --hard option changes all the files in your working tree to match the files in origin/master


WHY AUTOMATION QA SHOULD LEARN GIT?


Git is a powerful version control system that allows developers to manage changes to their codebase. Although Git was originally designed for software development, it has become an essential tool for automation testing as well. Here are some reasons why learning Git is important for automation testing:

  1. Version control: Git helps you keep track of changes to your test code over time. With Git, you can create a repository for your tests, and every time you make changes to your test code, you can commit those changes to the repository. This allows you to revert to an earlier version of your test code if necessary.

  2. Collaboration: Git allows multiple people to work on the same codebase simultaneously. This is useful for automation testing, where multiple testers may need to work on the same set of tests. With Git, testers can work on their own branch of the codebase and merge their changes into the main codebase when they're ready.

  3. Continuous integration: Git integrates well with continuous integration (CI) tools like Jenkins, Travis CI, and CircleCI. These tools allow you to automatically build, test, and deploy your code every time you make changes to the codebase. With Git, you can configure your CI tool to trigger builds and tests whenever changes are pushed to the repository.

  4. Code review: Git allows you to create pull requests, which are requests for other team members to review your code changes. This is a useful feature for automation testing, where it's important to ensure that your tests are of high quality and cover the necessary functionality. Pull requests allow other testers to review your tests and suggest improvements or catch errors.

Overall, Git is an essential tool for automation testing because it allows you to manage changes to your test code, collaborate with other testers, integrate with CI tools, and review code changes. Learning Git will make you a more efficient and effective automation tester.


43. Difference between soft, mixed, and hard resets?


Ans: Click Here For Answer


44. How to undo a git merge with conflicts?


The solution is quite dependent on the version of GIT you are using.


Latest Git Version:

git merge --abort


This attempts to reset your working copy to whatever state it was in before the merge. 


Prior to version 1.7.4:

git reset --merge


This is older syntax but does the same as the above.


Prior to version 1.6.2:

git reset --hard


 How to integrate Maven project with Jenkins?


ANS:  Maven & Jenkins Integration


45. What does cherry-picking a commit with GIT means?


Ans:  Let's Consider the following scenario. You have two branches.

a) release2 - This branch is going to your customer, but there are still some bugs to be fixed.

b) master - Classic master branch, where you can for example add functionality for release2.


NOW: You fix something in release2. Of course you need this fix also in master. And that is a typical use-case for cherry picking. So cherry pick in this scenario means that you take a commit from release2 branch and include it into the master branch.



46. Difference between rebase and merge?

    Ans: 
Click Here For Answer



47. How to delete a branch from local and remote?


To delete a local branch you can use below command

git branch -d the_local_branch

To remove a remote branch: be careful while doing this as it will delete a remote branch!

git push origin :the_remote_branch

or use the new syntax (v1.7.0)


git push origin --delete the_remote_branch


48. How to recover the dropped stash in GIT?


Ans: If you know the hash of the stash commit you have dropped, you can apply it as a stash:

git stash apply $stash_hash


49.How to create repository in bitbucket and push code 

for automation project?


Ans: Click Here For The Steps



50. What is the meaning of git conflict markers? VERY VERY IMP


Ans: Let's assume that after we pulled from remote branch, we got conflict, when we open the file it looks something like below:

<<<<<<< HEAD:file.txt

Hello world

=======

Adios Amigos

>>>>>>> 77976da35a11db46586:file.txt

A. The lines between the lines beginning <<<<<<< and  ======here:


<<<<<<< HEAD:file.txt

Hello world

=======

This above is what we already had locally - you can tell because HEAD points to your current branch or commit. 

B. The lines between the beginning ======= and >>>>>>>:

=======

Adios Amigos

>>>>>>> 99976da35a22db46586:file.txt

This is what was introduced by the other (pulled) commit, in this case 99976da35a22



51. Command to delete the file from your working directory and stages the deletion?


Ans: Click Here For Answer



REVISON:




32. How to rename a branch in GIT while working on it?


We can use the below command for renaming of the branch:

git branch -m <new name>


Click Here :   DevOps Related Posts



33. If we want to rename the branch from outside the branch then how we can do it?


git branch -m <old name> <new name>



39. How to track the remote branches in GIT?


Assuming there is a remote repository that you cloned your local repository from and also assuming that there is a branch named 'remote_branch' on that remote repository, here is how to track it locally:


# list remote branches

git branch -r


# start tracking one remote branch

git branch --track remote_branch origin/remote_branch


40.How to create repository in bitbucket  and push code for automation project?


       Ans: Click Here For The Steps


*******************************************************************

For any doubts or career guidance, arrange a 1:1 call with me 


https://topmate.io/sidharth_shukla


********************************************************************


Learn (API-Microservice)Testing+(CoreJava+UI)-SDET 

with Self Paced Videos and one LIVE Doubt Session

TRANING VIDEOS AVAILABLE with Live Doubt Session @4500/-(course-1 below,

API TRaining Videos With ClassNotes and Coding Set) and 6500/- (API+UI, both course-1 & 2 below) 

Check Training Page for Course Content or reach out @whatsapp +91-9619094122




Entire course content can be found below:  COURSE CONTENT


 Check GIT commands for Interview preparation SET-1:

GIT Interview Question 1 to 11

Check GIT commands for Interview preparation SET-2:

GIT Interview Question 12 to 21

Check GIT commands for Interview preparation SET-3:

GIT Interview Question 21 to 30

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions










Saturday, 6 November 2021

Top 15 DevOps Interview Questions and Answers for QA-SDET-DevOps 2022?


 How do I send email notifications with groovy script in Jenkins pipeline?

Pipeline Script Fundamentals

Click Here:   DevOps Related Posts


Before we start with complex Jenkins interview questions for experienced people, we should know more about Jenkins. So our first question is on the simple definition of Jenkins.


SDET Interview Question and Answers

TestNG Interview questions and answers

Jenkins Interview Questions and Answers

Appium Interview Questions and Answers

Selenium Interview Questions and answers

Java Coding Interview Questions and Answers

GIT Interview Questions and Answers

1. Let's first understand What is Devops?

DevOps is a combination of cultural philosophies, practices, and tools that increases an organization's ability to deliver applications and services at high velocity: evolving and improving products at a faster pace than organizations using traditional software development and infrastructure management processes.




2. How DevOps Works?

Under a DevOps model, development and operations teams are no longer “siloed.” Sometimes, these two teams are merged into a single team where the engineers work across the entire application lifecycle, from development and test to deployment to operations, and develop a range of skills not limited to a single function.

Some DevOps models, quality assurance and security teams may also become more tightly integrated with development and operations and throughout the application lifecycle. While security is the focus of everyone on a DevOps team, this is sometimes referred to as DevSecOps.

These teams use practices to automate processes that historically have been manual and slow. They use a technology stack and tooling which help them operate and evolve applications quickly and reliably. These tools also help engineers independently accomplish tasks (for example, deploying code or provisioning infrastructure) that normally would have required help from other teams, and this further increases a team’s velocity.

DEVOPS BEST PRACTICES EXPLAINED

3. What are the popular tools in DevOps? 

  • Jenkins/Bamboo: CICD tool 

  • Git: Version Control System(VCS) tool 

  • Selenium/Rest Assured: Continuous Testing(CT) tool for UI and API Automation

  • Chef, Puppet, Ansible: Configuration  Management and Deployment tools 

  • Nagios: Continuous Monitoring tools 

  • Docker: Containerization tool 

  • Kubernetes: Orchestration Tool


4. How to run Java application as Docker Image? Deploy Java application in Docker?


This is quite real-time, so I would suggest you try this in your local setup. 
All the steps are in
POST HERE


5. What is Pipeline, Node and Stage in Jenkins?

Click Here for All Pipeline Concepts and Terminology

6. What is Kibana and how is it used? 

Kibana is a visualisation tool that helps to visualize and create a dashboard using log data. The visualization feature helps to visualise data in the form of charts, graphs, scatter plots, data tables, donuts, and maps, etc. Kibana also supports dynamic and adaptive dashboards based on data queries.

7. What is Jenkins architecture? 

Jenkins is primarily a set of Java classes that model the concepts of a build system in a straightforward fashion. There are classes like 
Project, Build, that represents what the name says. The root of this object model is Hudson, and all the other model objects are reachable from here.

Then there are interfaces and classes that model code that performs a part of a build, such as
 SCM for accessing source code control system, Ant for performing an Ant-based build, Mailer for sending out email notifications.

For more details please follow the below link:
https://wiki.jenkins.io/display/JENKINS/Architecture

Docker Interview Question Set

8. How do I schedule a job at Jenkins? How to set nightly Automation Job?

Click Here For Schedule Job

9.  How you configure SonarQube with Jenkins?

For the integration of SonarQube in Jenkins, you have performed the following steps.

  1. Login into Jenkins and install the SonarQube scanner plugin
    Go to Manage Jenkins –> Manage Plugins > Available –> SonarQube scanner
    And also add credentials plugins to store your credentials in Jenkins


  2. Configure SonarQube home path
    Go to Manage Jenkins –> Global Tool Configuration –> SonarQube Scanner

    1. Name : sonar_scanner
    2. SONAR_RUNNER_HOME: Your directory path of SonarQube)

  3. Now, Configure SonarQube server in Jenkins
    1. For integration, you need a SonarQube Server authentication token in Jenkins
      i. Log in into your SonarQube Server and find the following under the user bar
      Go to My Account –> Security –> Generate Token

    2. Go to Manage Jenkins –> Configure Systems –> SonarQube Servers
      Name: SonarQube
      Server URL: Not Required is the same as the default
      Server authentication token :
      i. Add server authentication token as following


      ii. Select it as a server authentication token



  4. Save it. Your SonarQube integration is now complete with Jenkins. Create a job to test SonarQube and generate a report for your project.


10.  What is SonarQube and explain the components? 

Click here for answer on SonarQube with Components

11. How to Create, edit,  and scale the deployment using Kubernetes?  Click here for answers with examples: This is a very important aspect of DevOps, K8s provide containerization help to our very own containers
12. Explain some Ansible modules for Linux System Automation?

- The copy module allows you to copy a file from the Ansible control node to the target hosts

- The template module works similarly to the copy module, but it processes content dynamically using the Jinja2 templating language before copying it to the target hosts.

- The user module allows you to create and manage Linux users in your target system.

- The package module allows you to install, update, or remove software packages from your target system using the operating system standard package manager.

- The service module to manage the target system services using the required init system; for example, systemd.



13.What is AWS EC2 and ECS, and explain some features of it?


Kindly refer the POST HERE for details about EC2 and ECS. Those two are very 
important part of DevOps cycle.

14. What is Pipeline, Node and Stage in Jenkins?

ANS: Click Here for All Pipeline Concepts and Terminology


15. How to catch error in jenkins file and set build results to failure?

Ans: Using catchError.

If the body throws an exception, mark the build as a failure, but nonetheless continue to execute the Pipeline from the statement following the catchError step. The behavior of the step when an exception is thrown can be configured to print a message, set a build result other than failure, change the stage result, or ignore certain kinds of exceptions that are used to interrupt the build.

node {
    catchError {
        sh 'might fail'
    }
    step([$class: 'Mailer', recipients: 'admin@somewhere'])
}
To explore more, please refer: catchError()

NOW HERE IS THE Bonus Question :)

How to configure Maven in Jenkins?


  • Go to manage Jenkins->Global tool configuration

  • Click on Maven Installation




Click on Maven Installation and set Maven path



Click on the Save button and the configuration is complete.

*******************************************************************

For any doubts or career guidance, reach out to me :https://topmate.io/sidharth_shukla

****************************************

TOP 15 BDD - CUCUMBER Interview Q&A

  • ************************************************

    ✍️AUTHOR: LinkedIn Profile

    ************************************************

    Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

    SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below,API TRaining Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
    This includes classnotes, 300+ interview questions, 3 projects, Java Coding question set for product companies along with career guidance from FAANG employees for Automation and SDET.

    For more details whatsapp : https://lnkd.in/dnBWDM33

    *************************************************

    SeleniumWebdriver Automation Testing Interview Questions:

    https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver

    API Testing Interview Question Set:

    https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

    DevOps Interview Q&A:

    https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

    Kubernetes Interview Question Set

    https://automationreinvented.blogspot.com/search/label/Kubernetes

    Docker Interview Question Set

    https://automationreinvented.blogspot.com/Docker

    Linux Interview question Set

    https://automationreinvented.blogspot.com/search/label/Linux

    Automation Testing/SDET Framework Design

    https://automationreinvented.blogspot.com/search/label/FrameworkDesign

    Java Related Interview Question Set

    https://automationreinvented.blogspot.com/search/label/Java

    GIT Interview Question Set:

    https://automationreinvented.blogspot.com/2021/09/top-40-git-interview-questions-and.html

    Coding Interview Question Set:

    https://automationreinvented.blogspot.com/search/label/Coding%20Questions

    Mobile Testing Interview Question Set:

    https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

    Python Interview Question Set for QAE - SDET - SDE:

    https://automationreinvented.blogspot.com/search/label/Python


     


     


      

  •        Check GIT commands for Interview preparation SET-1:

    GIT Interview Question 1 to 11

    Check GIT commands for Interview preparation SET-2:

    GIT Interview Question 12 to 21

    Check GIT commands for Interview preparation SET-3:

    GIT Interview Question 21 to 30

    Check below link for question and answers with code:

    Top API Interview Question 1-10


    ************************************************

    API Testing Interview Question Set:
    https://automationreinvented.blogspot.com/search/label/Rest-API

     
    Kubernetes Interview Question Set
    https://automationreinvented.blogspot.com/search/label/Kubernetes

     
    Docker Interview Question Set
    https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

     
    Linux Interview question Set
    https://automationreinvented.blogspot.com/search/label/Linux

     
    Automation Testing/SDET Framework Design
    https://automationreinvented.blogspot.com/search/label/FrameworkDesign


    Java Related Interview Question Set

    https://automationreinvented.blogspot.com/search/label/Java


    GIT Interview Question Set:
    https://automationreinvented.blogspot.com/search/label/GIT


    Coding Interview Question Set:
    https://automationreinvented.blogspot.com/search/label/Coding%20Questions

    All Time Popular Posts

    Most Featured Post

    𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀?

    ❓ 𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀? The issue isn’t your logic—it’s the lack of pattern recogniti...