GithubHelp home page GithubHelp logo

soosterwaal / operias Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 5.0 335 KB

Operias is an open source tool to produce diff reports between your code and a given branch on github. It shows the differences in source file and the difference in code coverage in one simple overview.

Java 97.43% CSS 1.56% HTML 1.02%

operias's People

Contributors

anandsaw avatar luishgo avatar soosterwaal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

operias's Issues

Coverage Info in PR incorrect?

It seems some of the coverage shown by SERG-Delft/jpacman-framework#21 (comment) is not correct.

In the MapParser.html, the makeGhostSquare method is covered 'half':

image

where as in the plain cobertura file (which I manually created with mvn cobertura:cobertura on top of the pull request) it is fully covered:

image

It looks like the Operias coverage is a bit messed up here.

Step 1.2: Reading the arguments of operias

Initially, operias will need 2 arguments. The source directory in which your new source code is in, and the repository directory, which is where the original source code is in.

Change in arguments to let Operias work for automatic pull requests

The git arguments should be revised to:

Parameter Short parameter name Description
--repository-url -ru The repository url for both the original and revised version
--original-repository-url -oru The repository url of the original version
--revised-repository-url -rru The repository url of the revised version
--original-commit-id -oci The original commit id
--revised-commit-id -rci The revised commit id
--original-branch-name -obr The original branch name
--revised-branch-name -rbr The revised branch name

The rest of the arguments will stay the same. If a branch name was given, that no specific commit is needed. If no branch name was given, it will use the master branch as default.

Xml report containing specific metrics

Operias should generate a XML report containing some specific metrics, like:

  • How many lines were deleted, and what % was covered
  • How many lines were added, and what % of those lines are covered
  • How many lines were changed and what is the change of coverage for those lines
  • How many test lines were changed

Step 9: Command line arguments for better control over the execution of Operias

Several arguments should be able to be passed to operias through the commit line:

-d (--destination-folder), The destination folder where the generated html will go to
-r (--revised-folder), The folder with the revised source which needs to be compared to the original code
-o (--original-folder), The original source folder to which the code will be compared to
-c (--commit-id), The commit id to which the revised code will be compared to
-v (--verbose), Print out the status of operias

Either -o or -c should be provided

Comparing pull requests with >0 commits behind

If a pull request was made and the other branch was some commits behind, it will show differences in de code/coverage from the changed files in the commits that were not on the branch.

So, in order to work with Operias correctly for your pull request, you should update the branch before creating the pull request

Can Tests Have a UI?

Some of my tests require a UI. For that reason, I've configured travis as follows:

language: java
before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
script: "mvn clean test"

I suspect that Operias doesn't do this, which is why some of my tests fail.

Would something like that be possible for operias as well?

Or: Should operias use the .travis.yml if it is there?

Proper proccessing of embedded classes

If a class is embedded within another class, cobertura will make 2 "classes" for this file the original one, and for every embedded class it adds $1, $2, $3 etc after the class name. This is not handled properly yet in operias and the combined view can be a bit tricky because you don't know what part of a file is the embedded class when you show the source differences

Rounding percentages

The percentages next to the bars are rounded, this should be rounded to 2 decimals instead of 0

Step 5.1: Add another state to the file diff report

The file diff report contains the state of the source code for every file or directory, changed, new, deleted or same. The next step is to add another state to this, the state of the coverage, whether it is changed or stayed the same

Force 1% source change to at least 1 pixel in the overview

In the overview, in the bars, even a slightest change in covered should be forced to have a least 1 pixel.

Often you see no changes in colors, but a small change did happen. If you force it to be at least 1 pixel, you can always see that the coverage or source was changed

Documentation

The usage instructions should make it clear which "kinds of directories" are expected in the parameters:

--revised-directory -rd This directory contains the revised source code, this directory will be compared to the original directory
--original-directory -od This directory contains the original source code, unchanged.

Whether if should be the project dir or the source dir for instance.

Step 7.2: 4 different view when viewing a file

When opening a file, you should see 4 different views:

  • The original file, with the original coverage
  • The revised file, with the revised coverage
  • The source difference
  • The merged view

Confusing results when a file was deleted

As you can see in the image below. The coverage of the package was decreased to 0%. This is because the package was deleted. It should be clear that the package indeed was deleted. You can see it because 100% of the lines were removed. But if we look at the class, it said +15 lines (-100%) which is obviously wrong.

Also when opening a deleted class, the rows are not shaded.

And, same as the issue for the light/dark green bar, sometimes the light/dark red combination breaks

schermafbeelding 2014-03-21 om 09 29 20

schermafbeelding 2014-03-21 om 09 29 49

Step 7.1: Tree view in overview page

The overview page should be changed to a similar tree view as Eclemma provides. You start out with a list of changed packages, and you can open this package to view the sub packages and classes within the same table.

Also every package and class should get a bar containing the a visual representation of the changes in coverage

Step 4: Executing the project

The next step is to execute the test suite of the project to start measuring the coverage.

This should be done for both ant project and maven projects.

Step 1: Initial set up

The initial set up contains the initial project and the set up of the arguments for the tool and the set up of the test suite (if necessary).

  • Create the initial (maven) project
  • Determine which arguments must be used for the working of the tool
  • Set up coveralls and travis-ci so see what how coveralls is doing it's work

Confusing results when a new file was added

If we look at the image below, we can see that the package org.junit has a decreased coverage of 1,04%. But if we look at the files in the package, we don't see any changes. That is because the file AssumptionViolatedException was added, but not fully covered. We can see that it is new, only by the increase of relevant lines by 100%. But this could also mean that the source was doubled. So there must be a clear indiciation that the was indeed new, and that this is the cause of the coverage drop.

schermafbeelding 2014-03-20 om 09 24 29

Show Pass/Fail info on Tests Run?

In some cases coverage may be missing because tests fail -- which may be due to the different environment in which operias runs the tests.

Therefore, in the Operias report have a separate page with info on pass/fail per test would be useful.

Output should always be disabled

The output of information should be disabled by default. Now i will be turned of when the verbose argument is not given. It should be the other way around. Turn it ON when the verbose argument is given

Step 2: "Framework" for executing cobertura

The next step is to determine how cobertura will be executed. Initially, the tool will support maven projects only. Operias should execute the cobertura goal on maven and retrieve the report and parse this

0% on coverage and source status

In the sample below, you can see a class which has 0% change in coverage and 0% change in source.

In this case, the amount of relevant lines stayed the same, but some lines were just replaced

schermafbeelding 2014-03-21 om 09 52 43

Select the correct branch of the target directory

The next step is select the correct branch of the target directory. For this you need to execute git command line commands to checkout the correct branch.

  • Three arguments needed at least, source directory, git directory, branch name
  • Select the correct branch locally

Step 2.3: Construct diff coverage report

The xml reports must be parsed and checked for any difference between them. The files that differ in coverage should be marker and remembered for a next phase

Invalid argument + Help

When passing wrong or insufficient arguments to operias.Main class, no error message is presented. It would be useful to present the list of all possible arguments and its description, or potentially what may be missing.

Deleted files are not shown

In the final site, deleted files are not shown because they are not yet parsed and marked as changed files

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.