Giter VIP home page Giter VIP logo

anothertest's Introduction

RIT SWEN-559 GitHub Continuous Integration Lab

Pre-Lab

Review the notes from our lab to guide you.

Lab Part 1

Step 1: Fork repo at https://github.com/scioffi/SWEN-559-Test. You do not need to clone the repo or download anything. The entire lab can be completed using the GitHub web interface.

Step 2: Set Up Travis. Create a new file in the root directory named .travis.yml.

Add the following to your .travis.yml:

language: node_js
install:
  - npm install -g codecov
script:
  - istanbul cover ./node_modules/mocha/bin/_mocha --reporter lcovonly -- -R spec
  - codecov

Step 3: Set up codecov. Codecov is a serive that provides coverage reports for your test suite. We will be using Jest as part of the suite so add both of those dependencies to package.json.

In package.json supply either lcov.info or coverage-final.json to codecov:

{
  "scripts": {
    "report-coverage": "codecov",
    ...
  },
  "jest": {
    "coverageDirectory": "./coverage/",
    "collectCoverage": true
  }
  ...
}

Jest will now generate coverage files into coverage/

Run your tests with a command like this:

jest && codecov

Step 4: Set up Eslint. Eslint is a Javascript service that is used to ensure "clean-looking code"; it also ensures that the best practices are in play so the project can be consistent and worry-free.

Step 5: Configure Codecov file. Create new file called codecov.yml. Write and save the following to that file:

codecov:
  notify:
    require_ci_to_pass: yes

coverage:
  precision: 2
  round: down
  range: "95...100"

  status:
    project: yes
    patch: yes
    changes: no

parsers:
  gcov:
    branch_detection:
      conditional: yes
      loop: yes
      method: no
      macro: no

comment:
  layout: "header, diff"
  behavior: default
  require_changes: no

Lab Part 2

Step 1: Create a new branch called team-x where x is your group number.

Step 2: Commit new changes to the team branch and push to your forked repo remote branch.

Step 3: Navigate to https://github.com/scioffi/SWEN-559-Test/pulls and click New Pull Request

Step 4: Once you open the PR, you should see your TravisCI build kicking off which checks for several things. One of those checks will fail (linting error). Utilize your resources to fix the error and update your pull request on GitHub with a fix to the branch.

Step 5: Edit .travis.yml to include npm run test. Save and commit this file to the same branch. The pull request should update. Committing to the branch with the open PR will kick the checks off again and now this time it will run unit tests.

Step 6: You see one of the checks fails due to poor testing. Click on the "details" link in the corner of the TravisCI widget on the GitHub pull request. This will pull up the build failure and explain what exactly went wrong. Fix the bug in the tests and re-commit the code.

anothertest's People

Contributors

scioffi avatar

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.