Coder Social home page Coder Social logo

cypress-test-ansible's Introduction

Cypress Test Setup

Synopsis

Automating JIRA status changes, Git commits, and file generation.

Create an API Token

Ansible Automation

Update Vars in setup-vars.yml

Initial setup:

  • jira_b64_username_token: $(echo -n <user>@redhat.com:<jira_token> | base64)

  • project_path: $(pwd) <at the top level of the project containing the Cypress tests>

The only vars that need to be updated every time are:

  • jira_id: <AI-#>

  • test: <all-lowercase-hyphenated-test-name>

Setup Test

$ ansible-playbook setup-test.yml
  • Updates the JIRA status from Ready to In Progress

  • Creates a feature branch (with the proper naming convention) off of master

  • Generates files and populates them with skeleton code/documentation

Finish Test

$ ansible-playbook finish-test.yml
  • Stages the changes to the test/feature files if any are made and commits them

  • Updates JIRA status from In Progress to Ready to Review

    NOTE: You will need to manually push your changes (for now). Once you've done so, create a merge request and add it as a comment in the corresponding JIRA story.

Transition IDs for Reference

{
    "transitions": [
        {
            "id": "21",
            "name": "In Progress",
        },
        {
            "id": "31",
            "name": "Done",
        },
        {
            "id": "41",
            "name": "ToDo",
        },
        {
            "id": "51",
            "name": "Blocked",
        },
        {
            "id": "61",
            "name": "Ready To Demo",
        },
        {
            "id": "71",
            "name": "Ready",
        },
        {
            "id": "81",
            "name": "Ready To Review",
        }
    ]
}

Ideas/TODO

  • Arguably more trouble than it’s worth/goes against best practices (in finish-test.yml):

    • Automate pushing to Git and creating a merge request

      $ git push --set-upstream origin {{ feature_branch }} --no-verify -o merge_request.create -o merge_request.target=master
    • Grab the merge request URL and add it as a comment in the JIRA story with another POST request

  • Have the user override the JIRA id in a separate playbook for moving cards

  • Add more descriptive prerequisites for when to run a playbook and when not to (i.e. if a certain action has already been done) in the README

cypress-test-ansible's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.