Giter Club home page Giter Club logo

phaser's People

Contributors

basovnik avatar dependabot[bot] avatar mcarlett avatar osmman avatar vaclavchalupa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

phaser's Issues

Jobs composition

Allow to process multiple jobs by the Phaser. All phases defined in all jobs will be joined to single execution tree.

This feature allows to define 'parent' jobs with some global execution tasks and 'child' jobs with specific executions.

The benefit of composition over already supported inheritance:

  • child jobs can be executed separately - without execution defined in parent job
  • multiple child / parent job can be simply combined

Enable merging of multiple testcases into one report

If we have class like this:

public class TestClass {
	
	@GenerateReport
	public void firstTest() {
		// test
	}
	
	@GenerateReport
	public void secondTest() {
		// test
	}
}

we get two reports per class. We want to have only one with both test cases

Phase should be optional

If no phase definition for a phase is defined, following phases should be executed too.

For now, if there is no phase definition for a phase, following phases are not executed.

Design problems of InstanceRegistry class

Mayor design problems of InstanceRegistry class is in complete static implementation. It leads to this problems:

  • implementation is not thread save
  • cannot create different implementations of IR for example thread save implementation.
  • cannot use independently dependency injection between executed phases. This is main problem because it is not possible to execute independently more phases:
new Phaser(builder.build(), JobA.class.newInstance()).run(); // this execution alter InstanceRegistry
new Phaser(builder.build(), JobB.class.newInstance()).run(); // has access to JobA beans

Proposed solution is pass instance of InstanceRegistry when execute phaser (remote static behavior!).

Use case with two separate IR:

InstanceRegistry irA = new BasicInstanceRegistry();
InstanceRegistry irB = new BasicInstanceRegistry();
new Phaser(builder.build(), JobA.class.newInstance()).run(irA);
new Phaser(builder.build(), JobB.class.newInstance()).run(irB);

Use case with shared IR:

InstanceRegistry shared = new BasicInstanceRegistry();
new Phaser(builder.build(), JobA.class.newInstance()).run(shared);
new Phaser(builder.build(), JobB.class.newInstance()).run(shared);

Use case with thread save implementation:

InstanceRegistry shared = new ThreadSafeInstanceRegistry();
// run concurrent
ExecutorService executor = Executors.newFixedThreadPool(30);
Runnable worker1 = new Runnable(){
  public void run(){
    phaser.run(shared); 
  }
};
Runnable worker2 = new Runnable(){
  public void run(){
    phaser.run(shared); 
  }
};
executor.execute(worker1);
executor.execute(worker2);
executor.shutdown();

Use case with default behavior:

new Phaser(builder.build(), JobA.class.newInstance()).run(); // automatically create new basic instance of IR
new Phaser(builder.build(), JobB.class.newInstance()).run();  // automatically create new basic instance of IR

Change @Order type to any Number type

Double allows easier adding of new phase definition method on the right order - e.g. between already ordered method without the need to reorder.

Allow primitive types too, of course.

Exception handing

There is currently no exception handling.

2 ideas:

  • 1 Exceptions thrown in job class methods (phase definitions methods) should be catched by the Phaser. PhaseDefinitionProcessor can than have new method handleException(Exception e), where processor can handle exceptions from job methods / or re-throw it.
  • 2 New annotation RunAlways can be added to phase definition and job methods with this annotation will be executed always - event if an exception is thrown. (Finally methods.)

Multiple exceptions can then occurs in the Phaser, all of them should be saved and then (after all RunAlways methods) a wrapper exception will be thrown.

Change report dir to surefire-reports

polarion-uploader script uses RESULTS_DIR=$(find . -name "surefire-reports"), but now the reports are saved in phaser-reports dir, so it won't be able to find them

Add support for inject properties via annotation

It would be nice to add support for injection of system properties in script definitions.

First possible solution and easiest is using existing annotation @Inject. Only what is needed is fill InstanceRegistry with Property objects.

public class TestJob {

  @Inject("sys.property")
  private Property property;

  ...
}

Second possible solution is to create new annotation @Property which will load value from property register, convert it to target type and set filed.

public class TestJob {

  @Property("sys.property")
  private Integer property;

  @Property("sys.property2")
  private String property2;

  @Property("sys.projects")
  private Set<String> projects;

  ...
}

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.