From ed616e25d3077bdb6c70f6762de64291eb0b9bb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 09:23:44 +0700 Subject: [PATCH 001/233] bump actions/checkout from 3.3.0 to 3.4.0 (via #897) --- .github/workflows/build.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 984646994..85fcf7596 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: matrix: java-version: [ '17.0.x' ] steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v3.4.0 - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3ccdaa8ea..cc110864d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v3.4.0 - name: "Set up JDK 17.0.x" uses: actions/setup-java@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c76e6c1c3..f979969f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: "Check next version" run: | expr "${{ github.event.inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v3.4.0 with: token: ${{ secrets.QAMETA_CI }} From aa12687a21162abdf118dc89eb043bd3f194abfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 19:42:17 +0700 Subject: [PATCH 002/233] bump grpc from 1.51.0 to 1.53.0 (via #885) --- allure-grpc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allure-grpc/build.gradle.kts b/allure-grpc/build.gradle.kts index 909425d92..95e740dcc 100644 --- a/allure-grpc/build.gradle.kts +++ b/allure-grpc/build.gradle.kts @@ -8,7 +8,7 @@ description = "Allure gRPC Integration" val agent: Configuration by configurations.creating -val grpcVersion = "1.51.0" +val grpcVersion = "1.53.0" val protobufVersion = "3.21.11" dependencies { From c38165d432e24109fe331945d2a2bb3838fcd74c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:20:16 +0700 Subject: [PATCH 003/233] bump actions/checkout from 3.4.0 to 3.5.0 (via #901) --- .github/workflows/build.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85fcf7596..b246f73fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: matrix: java-version: [ '17.0.x' ] steps: - - uses: actions/checkout@v3.4.0 + - uses: actions/checkout@v3.5.0 - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cc110864d..a39bb2342 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.4.0 + - uses: actions/checkout@v3.5.0 - name: "Set up JDK 17.0.x" uses: actions/setup-java@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f979969f7..65c319419 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: "Check next version" run: | expr "${{ github.event.inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' - - uses: actions/checkout@v3.4.0 + - uses: actions/checkout@v3.5.0 with: token: ${{ secrets.QAMETA_CI }} From 257e58b701534771434471550f5b06f552d9fff4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:20:39 +0700 Subject: [PATCH 004/233] bump com.gradle.enterprise from 3.11.4 to 3.12.5 (via #900) --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 45f8d4d16..9bd09f36b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -47,7 +47,7 @@ pluginManagement { plugins { id("com.diffplug.spotless") version "6.11.0" id("com.github.johnrengelman.shadow") version "7.1.2" - id("com.gradle.enterprise") version "3.11.4" + id("com.gradle.enterprise") version "3.12.5" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" id("io.qameta.allure-adapter") version "2.11.2" id("io.qameta.allure-aggregate-report") version "2.11.2" From 8fe20871f08e23562656e392d78487835114ab0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:21:06 +0700 Subject: [PATCH 005/233] bump protobuf from 3.21.11 to 3.22.2 (via #899) --- allure-grpc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allure-grpc/build.gradle.kts b/allure-grpc/build.gradle.kts index 95e740dcc..f0bed5402 100644 --- a/allure-grpc/build.gradle.kts +++ b/allure-grpc/build.gradle.kts @@ -9,7 +9,7 @@ description = "Allure gRPC Integration" val agent: Configuration by configurations.creating val grpcVersion = "1.53.0" -val protobufVersion = "3.21.11" +val protobufVersion = "3.22.2" dependencies { agent("org.aspectj:aspectjweaver") From 90df7680e0fdf0cffb8ed933fafd521dc25dbf7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 14:47:44 +0400 Subject: [PATCH 006/233] bump org.junit:junit-bom from 5.8.2 to 5.9.2 (via #902) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index a1acd27c6..2bcec2774 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -135,7 +135,7 @@ configure(libs) { dependencyManagement { imports { mavenBom("com.fasterxml.jackson:jackson-bom:2.14.1") - mavenBom("org.junit:junit-bom:5.8.2") + mavenBom("org.junit:junit-bom:5.9.2") } dependencies { dependency("com.github.spotbugs:spotbugs:4.7.3") From 7cdc159583f6cb80fdcce7c8f79891b45b3eb6f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 11:41:04 +0100 Subject: [PATCH 007/233] bump actions/checkout from 3.5.0 to 3.5.2 (via #909) --- .github/workflows/build.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b246f73fc..71ee8b12e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: matrix: java-version: [ '17.0.x' ] steps: - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3.5.2 - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a39bb2342..f630c357f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3.5.2 - name: "Set up JDK 17.0.x" uses: actions/setup-java@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65c319419..5bda188d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: "Check next version" run: | expr "${{ github.event.inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3.5.2 with: token: ${{ secrets.QAMETA_CI }} From 34b4f8098fd6e8a75d2ee7680ce52b40d2280030 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 11:41:32 +0100 Subject: [PATCH 008/233] bump org.mockito:mockito-core from 5.1.1 to 5.3.0 (via #907) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2bcec2774..ffd686fc1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -159,7 +159,7 @@ configure(libs) { dependency("org.hamcrest:hamcrest:2.2") dependency("org.jboss.resteasy:resteasy-client:6.2.1.Final") dependency("org.mock-server:mockserver-netty:5.14.0") - dependency("org.mockito:mockito-core:5.1.1") + dependency("org.mockito:mockito-core:5.3.0") dependency("org.slf4j:slf4j-api:${orgSlf4jVersion}") dependency("org.slf4j:slf4j-nop:${orgSlf4jVersion}") dependency("org.slf4j:slf4j-simple:${orgSlf4jVersion}") From 808c39a866b3059f3b20be57eefa8ea7c0e8ba94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 14:52:49 +0100 Subject: [PATCH 009/233] bump org.mock-server:mockserver-netty from 5.14.0 to 5.15.0 (via #911) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index ffd686fc1..04c4bdaef 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -158,7 +158,7 @@ configure(libs) { dependency("org.grpcmock:grpcmock-junit5:0.8.0") dependency("org.hamcrest:hamcrest:2.2") dependency("org.jboss.resteasy:resteasy-client:6.2.1.Final") - dependency("org.mock-server:mockserver-netty:5.14.0") + dependency("org.mock-server:mockserver-netty:5.15.0") dependency("org.mockito:mockito-core:5.3.0") dependency("org.slf4j:slf4j-api:${orgSlf4jVersion}") dependency("org.slf4j:slf4j-nop:${orgSlf4jVersion}") From ec0e9bcf0b7364c1f6021b19738bbaa4bdc25feb Mon Sep 17 00:00:00 2001 From: Dmitry Baev Date: Fri, 28 Apr 2023 11:56:36 +0100 Subject: [PATCH 010/233] add karate integration (via #548) --- allure-karate/build.gradle.kts | 55 +++ .../io/qameta/allure/karate/AllureKarate.java | 356 ++++++++++++++++++ .../allure/karate/AllureKarateTest.java | 322 ++++++++++++++++ .../io/qameta/allure/karate/TestRunner.java | 94 +++++ .../src/test/resources/testdata/api.feature | 16 + .../resources/testdata/apiResponse.feature | 13 + .../testdata/description-and-name.feature | 10 + .../test/resources/testdata/greeting.feature | 19 + .../src/test/resources/testdata/links.feature | 8 + .../testdata/parametrized-test.feature | 13 + .../resources/testdata/screenshot.feature | 12 + .../src/test/resources/testdata/steps.feature | 16 + .../src/test/resources/testdata/tags.feature | 21 ++ .../src/test/resources/testdata/web.feature | 20 + settings.gradle.kts | 1 + 15 files changed, 976 insertions(+) create mode 100644 allure-karate/build.gradle.kts create mode 100644 allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java create mode 100644 allure-karate/src/test/java/io/qameta/allure/karate/AllureKarateTest.java create mode 100644 allure-karate/src/test/java/io/qameta/allure/karate/TestRunner.java create mode 100644 allure-karate/src/test/resources/testdata/api.feature create mode 100644 allure-karate/src/test/resources/testdata/apiResponse.feature create mode 100644 allure-karate/src/test/resources/testdata/description-and-name.feature create mode 100644 allure-karate/src/test/resources/testdata/greeting.feature create mode 100644 allure-karate/src/test/resources/testdata/links.feature create mode 100644 allure-karate/src/test/resources/testdata/parametrized-test.feature create mode 100644 allure-karate/src/test/resources/testdata/screenshot.feature create mode 100644 allure-karate/src/test/resources/testdata/steps.feature create mode 100644 allure-karate/src/test/resources/testdata/tags.feature create mode 100644 allure-karate/src/test/resources/testdata/web.feature diff --git a/allure-karate/build.gradle.kts b/allure-karate/build.gradle.kts new file mode 100644 index 000000000..fb7aef326 --- /dev/null +++ b/allure-karate/build.gradle.kts @@ -0,0 +1,55 @@ +description = "Allure Karate Integration" + +val karateVersion = "1.3.1" + +configurations { + testImplementation { + exclude(group="ch.qos.logback", module = "logback-classic") + } +} + +dependencies { + api(project(":allure-java-commons")) + implementation("com.intuit.karate:karate-core:${karateVersion}") + implementation(project(":allure-test-filter")) + testAnnotationProcessor("org.slf4j:slf4j-simple") + testAnnotationProcessor(project(":allure-descriptions-javadoc")) + testImplementation("io.github.glytching:junit-extensions") + testImplementation("org.assertj:assertj-core") + testImplementation("org.junit.jupiter:junit-jupiter-api") + testImplementation("org.junit.jupiter:junit-jupiter-params") + testImplementation("org.slf4j:slf4j-simple") + testImplementation(project(":allure-java-commons-test")) + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") + testImplementation("org.mock-server:mockserver-netty:5.14.0") +} + +tasks.jar { + manifest { + attributes(mapOf( + "Automatic-Module-Name" to "io.qameta.allure.karate" + )) + } + from("src/main/services") { + into("META-INF/services") + } +} + +tasks.test { + systemProperty("junit.jupiter.execution.parallel.enabled", "false") + useJUnitPlatform() + exclude("**/features/*") +} + +val spiOffJar: Jar by tasks.creating(Jar::class) { + from(sourceSets.getByName("main").output) + archiveClassifier.set("spi-off") +} + +publishing { + publications { + named("maven") { + artifact(spiOffJar) + } + } +} \ No newline at end of file diff --git a/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java b/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java new file mode 100644 index 000000000..9629018e3 --- /dev/null +++ b/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java @@ -0,0 +1,356 @@ +/* + * Copyright 2021 Qameta Software OÜ + * + * 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.karate; + +import com.intuit.karate.RuntimeHook; +import com.intuit.karate.core.Feature; +import com.intuit.karate.core.FeatureRuntime; +import com.intuit.karate.core.Result; +import com.intuit.karate.core.Scenario; +import com.intuit.karate.core.ScenarioResult; +import com.intuit.karate.core.ScenarioRuntime; +import com.intuit.karate.core.Step; +import com.intuit.karate.core.StepResult; +import io.qameta.allure.Allure; +import io.qameta.allure.AllureLifecycle; +import io.qameta.allure.model.Attachment; +import io.qameta.allure.model.Label; +import io.qameta.allure.model.Link; +import io.qameta.allure.model.Parameter; +import io.qameta.allure.model.Stage; +import io.qameta.allure.model.Status; +import io.qameta.allure.model.StatusDetails; +import io.qameta.allure.model.TestResult; +import io.qameta.allure.util.ResultsUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.stream.Collectors; + +import static io.qameta.allure.util.ResultsUtils.createLabel; +import static io.qameta.allure.util.ResultsUtils.createLink; +import static io.qameta.allure.util.ResultsUtils.createParameter; + +/** + * @author charlie (Dmitry Baev). + */ +@SuppressWarnings("MultipleStringLiterals") +public class AllureKarate implements RuntimeHook { + + private static final Logger LOGGER = LoggerFactory.getLogger(AllureKarate.class); + + private static final String ALLURE_UUID = "ALLURE_UUID"; + + private final AllureLifecycle lifecycle; + + private final ReadWriteLock lock = new ReentrantReadWriteLock(); + + private final Map stepsAndTcUuids = new HashMap<>(); + private final Map stepAndUuids = new HashMap<>(); + + private final List tcUuids = new ArrayList<>(); + + public AllureKarate() { + this(Allure.getLifecycle()); + } + + public AllureKarate(final AllureLifecycle lifecycle) { + this.lifecycle = lifecycle; + } + + @Override + public boolean beforeScenario(final ScenarioRuntime sr) { + final Feature feature = sr.featureRuntime.result.getFeature(); + final String featureName = feature.getName(); + final String featureNameQualified = feature.getPackageQualifiedName(); + final Scenario scenario = sr.scenario; + final String scenarioName = scenario.getName(); + + final String uuid = UUID.randomUUID().toString(); + sr.magicVariables.put(ALLURE_UUID, uuid); + + final TestResult result = new TestResult() + .setUuid(uuid) + .setFullName(String.format("%s | %s", featureNameQualified, scenarioName)) + .setName(scenarioName) + .setDescription(scenario.getDescription()) + .setTestCaseId(scenario.getUniqueId()) + .setStage(Stage.RUNNING); + + final List labels = sr.tags.getTags(); + final List