Skip to content

Commit

Permalink
⚗️ add dateIl labels
Browse files Browse the repository at this point in the history
  • Loading branch information
sdd committed Aug 12, 2024
1 parent 56e8f1d commit ce08ceb
Show file tree
Hide file tree
Showing 14 changed files with 317 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ npm-debug.log
.DS_Store

# Test logs
logs
# logs
allure-report
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Allure Report-IL (Linux)

## Structure
```
# Создаем страницу Login
├── 📁 allure-commandline/ # build prod file
├── 📁 allure-generator/ # generator web
├── 📁 allure-jira-commons/ #
├── 📁 allure-plugin-api/ #
├── 📁 plugins/ #
└── ... #
```

## BUILD ALLURE
### Prod build Allure project
```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
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.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 @@ -25,7 +25,7 @@
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.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 @@ -173,6 +173,8 @@ protected 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
@@ -0,0 +1,49 @@
/*
* Copyright 2016-2024 Qameta Software Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.qameta.allure.owner;

import io.qameta.allure.Aggregator2;
import io.qameta.allure.ReportStorage;
import io.qameta.allure.core.Configuration;
import io.qameta.allure.core.LaunchResults;
import io.qameta.allure.entity.LabelName;
import io.qameta.allure.entity.TestResult;

import java.util.List;

/**
* Plugin that adds owner information to test results.
*
* @since 2.0
*/
public class DateIlPlugin implements Aggregator2 {

public static final String OWNER_BLOCK_NAME = "dateIl";

@Override
public void aggregate(final Configuration configuration,
final List<LaunchResults> launchesResults,
final ReportStorage storage) {
launchesResults.stream()
.flatMap(results -> results.getResults().stream())
.forEach(this::setOwner);
}

private void setOwner(final TestResult result) {
result.findOneLabel(LabelName.DATEIL)
.ifPresent(owner -> result.addExtraBlock(OWNER_BLOCK_NAME, owner));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
public class DefaultTreeGroup implements TreeGroup {

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

private List<TreeNode> children = new ArrayList<>();

Expand All @@ -49,6 +51,10 @@ public void addChild(final TreeNode node) {
public void setName(final String name) {
this.name = name;
}
// #IL_add Добавим дату
public void setDateIl(final String dateIl) {
this.dateIl = dateIl;
}

public void setChildren(final List<TreeNode> children) {
this.children = children;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import static io.qameta.allure.tree.TreeUtils.createGroupUid;
// #IL_add Добавим дату
import static io.qameta.allure.tree.TreeUtils.dateIl_TEST;
import static io.qameta.allure.tree.TreeUtils.dateIlTest;
/**
* @author charlie (Dmitry Baev).
*/
Expand All @@ -29,6 +29,6 @@ public class TestResultGroupFactory implements TreeGroupFactory<TestResult, Test
public TestResultTreeGroup create(final TestResultTreeGroup parent, final String name, final TestResult item) {
return new TestResultTreeGroup(createGroupUid(parent.getUid(), name), name,
// #IL_add Добавим дату
dateIl_TEST(parent.getDateIl()) );
dateIlTest(parent.getDateIl()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static String createGroupUid(final String parentUid, final String groupNa
return DatatypeConverter.printHexBinary(md.digest()).toLowerCase();
}
// #IL_add Добавим дату
public static String dateIl_TEST(final String dateIl) {
public static String dateIlTest(final String dateIl) {
return dateIl;
}

Expand Down
14 changes: 14 additions & 0 deletions logs/001-result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "",
"status": "failed",
"stage": "finished",
"description": "",
"dateIl": "88.88.2024",
"links": [],
"labels": [
{
"name": "dateIl",
"value": "12/08/2024"
}
]
}
73 changes: 73 additions & 0 deletions logs/85885b3e-1730-44f8-9c6f-c2218ff3b838-container.json

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions logs/fd1d1937-2207-4a7f-ba20-b53f1a8fb63f-result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"name": "Creating new issue for authorized user",
"status": "failed",
"statusDetails": {
"known": false,
"muted": false,
"flaky": false,
"message": "WebDriverException: chrome not reachable\nElement not found {By.xpath: //a[@href='/eroshenkoam/allure-example']}\nExpected: text 'Allure'\nPage source: file:/Users/eroshenkoam/Developer/eroshenkoam/webdriver-coverage-example/build/reports/tests/1603973861960.0.html\nTimeout: 4 s.",
"trace": "org.opentest4j.AssertionFailedError: WebDriverException: chrome not reachable\nElement not found {By.xpath: //a[@href='/eroshenkoam/allure-example']}\nExpected: text 'Allure'\nPage source: file:/Users/eroshenkoam/Developer/eroshenkoam/webdriver-coverage-example/build/reports/tests/1603973861960.0.html\nTimeout: 4 s.\n\tat org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)\n\tat org.junit.jupiter.api.Assertions.fail(Assertions.java:117)\n\tat io.qameta.allure.WebSteps.maybeThrowSeleniumTimeoutException(WebSteps.java:94)\n\tat io.qameta.allure.WebSteps.stopDriver(WebSteps.java:27)\n\tat io.qameta.allure.PullRequestsWebTest.stopDriver(PullRequestsWebTest.java:59)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)\n\tat org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)\n\tat io.qameta.allure.junit5.AllureJunit5.processFixture(AllureJunit5.java:87)\n\tat io.qameta.allure.junit5.AllureJunit5.interceptAfterEachMethod(AllureJunit5.java:73)\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)\n\tat org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)\n\tat org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(TimeoutExtension.java:126)\n\tat org.junit.jupiter.engine.extension.TimeoutExtension.interceptAfterEachMethod(TimeoutExtension.java:108)\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)\n\tat org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeMethodInExtensionContext(ClassBasedTestDescriptor.java:490)\n\tat org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$synthesizeAfterEachMethodAdapter$20(ClassBasedTestDescriptor.java:480)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachMethods$9(TestMethodTestDescriptor.java:236)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$12(TestMethodTestDescriptor.java:269)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:269)\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1541)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAllAfterMethodsOrCallbacks(TestMethodTestDescriptor.java:268)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAfterEachMethods(TestMethodTestDescriptor.java:234)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)\n\tat org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.executeNonConcurrentTasks(ForkJoinPoolHierarchicalTestExecutorService.java:155)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.invokeAll(ForkJoinPoolHierarchicalTestExecutorService.java:135)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)\n\tat org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.executeNonConcurrentTasks(ForkJoinPoolHierarchicalTestExecutorService.java:155)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.invokeAll(ForkJoinPoolHierarchicalTestExecutorService.java:135)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)\n\tat org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)\n\tat org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)\n\tat java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)\n"
},
"stage": "finished",
"description": "",
"steps": [
{
"name": "Open pull requests page `allure-framework/allure2`",
"dateIl": "88.88.2024",
"status": "passed",
"stage": "finished",
"labels": [
{
"name": "dateIl",
"value": "12/08/2024"
}
],
"steps": [],
"attachments": [{
"name": "Page",
"dateIl": "88.88.2024",
"source": "3fe8917f-9623-42b8-bfeb-cd878dec105c-attachment.html",
"type": "text/html"
}],
"parameters": [{
"name": "owner",
"dateIl": "88.88.2024",
"value": "allure-framework"
}, {
"name": "repo",
"dateIl": "88.88.2024",
"value": "allure2"
}],
"start": 1635177213467,
"stop": 1635177214471
}, {
"name": "Create pull request from branch `new-feature`",
"dateIl": "88.88.2024",
"status": "passed",
"stage": "finished",
"steps": [],
"labels": [
{
"name": "dateIl",
"value": "12/08/2024"
}
],
"attachments": [],
"parameters": [{
"name": "branch",
"dateIl": "88.88.2024",
"value": "new-feature"
}],
"start": 1635177214471,
"stop": 1635177215475
}, {
"name": "Check pull request for branch `new-feature` exists",
"dateIl": "88.88.2024",
"status": "passed",
"stage": "finished",
"labels": [
{
"name": "dateIl",
"value": "12/08/2024"
}
],
"steps": [],
"attachments": [],
"parameters": [{
"name": "branch",
"dateIl": "88.88.2024",
"value": "new-feature"
}],
"start": 1635177215476,
"stop": 1635177215476
}
],
"attachments": [],
"parameters": [],
"start": 1635177213466,
"stop": 1635177215490,
"uuid": "fd1d1937-2207-4a7f-ba20-b53f1a8fb63f",
"historyId": "b4f6403523fb41de7d369843de9745d8",
"fullName": "io.qameta.allure.PullRequestsWebTest.shouldCreatePullRequest",
"dateIl": "08.08.2024",
"labels": [
{
"name": "dateIl",
"value": "08.08.2024"
}, {
"name": "tag",
"value": "regress"
}, {
"name": "tag",
"value": "smoke"
}, {
"name": "layer",
"value": "web"
}, {
"name": "owner",
"value": "eroshenkoam"
}, {
"name": "feature",
"value": "Pull Requests"
}, {
"name": "jira",
"value": "AE-1"
}, {
"name": "tm4j",
"value": "AE-T6"
}, {
"name": "jira",
"value": "AE-2"
}, {
"name": "msrv",
"value": "Billing"
}, {
"name": "story",
"value": "Create new pull request"
}, {
"name": "host",
"value": "ip-192-168-31-222.eu-central-1.compute.internal"
}, {
"name": "thread",
"value": "38312@ip-192-168-31-222.eu-central-1.compute.internal.ForkJoinPool-1-worker-19(24)"
}, {
"name": "framework",
"value": "junit-platform"
}, {
"name": "language",
"value": "java"
}, {
"name": "package",
"value": "io.qameta.allure.PullRequestsWebTest"
}, {
"name": "testClass",
"value": "io.qameta.allure.PullRequestsWebTest"
}, {
"name": "testMethod",
"value": "shouldCreatePullRequest"
}, {
"name": "suite",
"value": "io.qameta.allure.PullRequestsWebTest"
}
],
"links": []
}

0 comments on commit ce08ceb

Please sign in to comment.