Skip to content

Commit

Permalink
🚧 date-il v1
Browse files Browse the repository at this point in the history
  • Loading branch information
sdd committed Aug 9, 2024
1 parent 3bf5de4 commit 56e8f1d
Show file tree
Hide file tree
Showing 24 changed files with 119 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ sudo ln -svf /home/jdk-17.0.6+10/bin/java /usr/bin/java17
java -version17
```


#### Add code
1. #IL_add **Добавим дату**
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import io.qameta.allure.core.Configuration;
import io.qameta.allure.core.ResultsVisitor;
import io.qameta.allure.entity.Attachment;
// #IL_add Добавим дату
import io.qameta.allure.entity.DateIl;
import io.qameta.allure.entity.Label;
import io.qameta.allure.entity.LabelName;
import io.qameta.allure.entity.Link;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import io.qameta.allure.core.Configuration;
import io.qameta.allure.core.ResultsVisitor;
import io.qameta.allure.entity.Attachment;
// #IL_add Добавим дату
import io.qameta.allure.entity.DateIl;
import io.qameta.allure.entity.Label;
import io.qameta.allure.entity.Link;
import io.qameta.allure.entity.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ public class Category implements Serializable {
protected String traceRegex;
protected List<Status> matchedStatuses = new ArrayList<>();
protected boolean flaky;

// #IL_add Добавим дату
protected String dateIl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ private static TreeWidgetItem toWidgetItem(final TestResultTreeGroup group) {
return new TreeWidgetItem()
.setUid(group.getUid())
.setName(group.getName())
// #IL_add Добавим дату
.setDateIl(group.getDateIl())
.setStatistic(calculateStatisticByLeafs(group));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
&__name {
//flex: 0 0 30%;
}
&__dateIl{
padding-left: 5px;
color: rgb(252, 114, 114);
}
&__unknown {
color: $text-muted-color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<div class="node__name">
{{name}}
</div>
{{#if dateIl}}
<div class="node__dateIl">
{{dateIl}}
</div>
{{/if}}
{{else}}
<span class="node__unknown">{{t 'component.tree.unknown'}}</span>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<div class="node__name">
{{name}}
</div>
<div>DATE - </div>
{{#if dateIl}}
<div class="node__dateIl">
{{dateIl}}
</div>
{{/if}}
{{#if parameters}}
<div class="node__parameters long-line line-ellipsis">
<span>&nbsp</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class PluginConfiguration implements Serializable {
private String id;
private String name;
private String description;
// #IL_add Добавим дату
private String dateIl;
private List<String> extensions = new ArrayList<>();
private List<String> jsFiles = new ArrayList<>();
private List<String> cssFiles = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// #IL_add Добавим дату

package io.qameta.allure.entity;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
public class DateIl implements Serializable {

protected String dateIl;

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class ExecutorInfo implements Serializable {
private static final long serialVersionUID = 1L;

protected String name;
// #IL_add Добавим дату
protected String dateIl;
protected String type;
protected String url;
protected Long buildOrder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
public enum LabelName implements Serializable {

OWNER("owner"),
// #IL_add Добавим дату
DATEIL("dateIl"),
SEVERITY("severity"),
ISSUE("issue"),
TAG("tag"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class Link implements Serializable {
private static final long serialVersionUID = 1L;

protected String name;
// #IL_add Добавим дату
protected String dateIl;
protected String url;
protected String type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class Parameter implements Serializable {
private static final long serialVersionUID = 1L;

protected String name;
// #IL_add Добавим дату
protected String dateIl;
protected String value;

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class StageResult implements Serializable, Summarizable {
private static final long serialVersionUID = 1L;

protected String name;
// #IL_add Добавим дату
protected String dateIl;
protected Time time;

protected String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public class TestResult implements Serializable, Nameable, Parameterizable, Stat
protected boolean newFailed;
protected boolean newBroken;
protected boolean newPassed;
// #IL_add Добавим дату
protected String dateIl;

protected int retriesCount;
protected boolean retriesStatusChange;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,26 @@
public class DefaultTreeLeaf implements TreeLeaf {

private final String name;
// #IL_add Добавим дату
private String dateIl;

public DefaultTreeLeaf(final String name) {
public DefaultTreeLeaf(final String name, final String dateIl) {
this.name = name;
// #IL_add Добавим дату
this.dateIl = dateIl;
}

@Override
public String getName() {
return name;
}


// #IL_add Добавим дату
public String getDateIl() {
return dateIl;
}
// #IL_add Добавим дату
public void setDateIl(final String dateIl) {
this.dateIl = dateIl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
import io.qameta.allure.entity.TestResult;

import static io.qameta.allure.tree.TreeUtils.createGroupUid;

// #IL_add Добавим дату
import static io.qameta.allure.tree.TreeUtils.dateIl_TEST;
/**
* @author charlie (Dmitry Baev).
*/
public class TestResultGroupFactory implements TreeGroupFactory<TestResult, TestResultTreeGroup> {

@Override
public TestResultTreeGroup create(final TestResultTreeGroup parent, final String name, final TestResult item) {
return new TestResultTreeGroup(createGroupUid(parent.getUid(), name), name);
return new TestResultTreeGroup(createGroupUid(parent.getUid(), name), name,
// #IL_add Добавим дату
dateIl_TEST(parent.getDateIl()) );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import io.qameta.allure.entity.TestResult;

import static io.qameta.allure.tree.TreeUtils.createGroupUid;

// #IL_add Добавим дату
import static io.qameta.allure.tree.TreeUtils.dateIl_TEST;
/**
* @author charlie (Dmitry Baev).
*/
Expand All @@ -31,7 +32,9 @@ public TestResultTree(final String name, final TreeClassifier<TestResult> treeCl
public TestResultTree(final String name, final TreeClassifier<TestResult> treeClassifier,
final TreeGroupFactory<TestResult, TestResultTreeGroup> groupFactory,
final TreeLeafFactory<TestResult, TestResultTreeGroup, TestResultTreeLeaf> leafFactory) {
super(new TestResultTreeGroup(createGroupUid(null, name), name),
super(new TestResultTreeGroup(createGroupUid(null, name), name,
// #IL_add Добавим дату
dateIl_TEST(name)),
treeClassifier, groupFactory, leafFactory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,30 @@
public class TestResultTreeGroup extends DefaultTreeGroup {

private String uid;
// #IL_add Добавим дату
private String dateIl;

public TestResultTreeGroup(final String uid, final String name) {
public TestResultTreeGroup(final String uid, final String name, final String dateIl) {
super(name);
this.uid = uid;
// #IL_add Добавим дату
this.dateIl = dateIl;
}

public String getUid() {
return uid;
}
// #IL_add Добавим дату
public String getDateIl() {
return dateIl;
}

public void setUid(final String uid) {
this.uid = uid;
}
// #IL_add Добавим дату
public void setDateIl(final String dateIl) {
this.dateIl = dateIl;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class TestResultTreeLeaf extends DefaultTreeLeaf {

private final String uid;
private final String parentUid;
// #IL_add Добавим дату
// private final String dateIl;
private final Status status;
private final Time time;
private final boolean flaky;
Expand All @@ -45,14 +47,20 @@ public TestResultTreeLeaf(final String parentUid, final TestResult testResult) {
this(
parentUid,
testResult.getName(),
// #IL_add Добавим дату
testResult.getDateIl(),
testResult
);
}

public TestResultTreeLeaf(final String parentUid, final String name, final TestResult testResult) {
super(name);
public TestResultTreeLeaf(final String parentUid, final String name,
// #IL_add Добавим дату
final String dateIl, final TestResult testResult) {
super(name, dateIl);
this.parentUid = parentUid;
this.uid = testResult.getUid();
// #IL_add Добавим дату
// this.dateIl = dateIl;
this.status = testResult.getStatus();
this.time = testResult.getTime();
this.flaky = testResult.isFlaky();
Expand All @@ -71,6 +79,10 @@ public String getParentUid() {
public String getUid() {
return uid;
}
// #IL_add Добавим дату
// public String getDateIl() {
// return dateIl;
// }

public Status getStatus() {
return status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public static String createGroupUid(final String parentUid, final String groupNa
md.update(Objects.toString(groupName).getBytes(UTF_8));
return DatatypeConverter.printHexBinary(md.digest()).toLowerCase();
}
// #IL_add Добавим дату
public static String dateIl_TEST(final String dateIl) {
return dateIl;
}

public static List<TreeLayer> groupByLabels(final TestResult testResult,
final LabelName... labelNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class TreeWidgetItem implements Serializable {

protected String uid;
protected String name;
// #IL_add Добавим дату
protected String dateIl;
protected Statistic statistic;

}
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,14 @@ private TestResultTreeLeaf createLeaf(final TestResultTreeGroup parent, final Te
.findOneLabel(LabelName.TEST_METHOD)
.filter(method -> !method.isEmpty())
.orElseGet(testResult::getName);
final String dateIl = testResult
.findOneLabel(LabelName.DATEIL)
.filter(method -> !method.isEmpty())
.orElseGet(testResult::getDateIl);
return new TestResultTreeLeaf(
parent.getUid(),
name,
dateIl,
testResult
);
}
Expand Down

0 comments on commit 56e8f1d

Please sign in to comment.