Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add X-Ray integration with Jira #446

Merged
merged 11 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/upload-to-xray/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Upload to X-Ray"
description: "Uploads test results to X-Ray"
inputs:
username:
description: "XRAY_CLIENT_ID for authentication"
required: true
password:
description: "XRAY_CLIENT_SECRET for authentication"
required: true
json:
description: "Path to JSON to import"
required: true
execution_tag:
description: "X-Ray Tests Execution to upload results"
required: true
scripts_path:
description: "Path to Python scripts to update test execution in results"
required: false
default: "./tests/e2e-tests/src/test/resources/scripts"
url:
description: "X-Ray Cloud URL"
required: false
default: "https://xray.cloud.getxray.app"
runs:
using: "composite"
steps:
- name: "Upload results to X-Ray"
shell: bash
run: |
pip install -r ${{ inputs.scripts_path }}/requirements.txt
ls -la ${PWD}/${{ inputs.json }}
cat ${PWD}/${{ inputs.json }}
${{ inputs.scripts_path }}/add_test_execution.py "${PWD}/${{ inputs.json }}" "${{ inputs.execution_tag }}"
XRAY_TOKEN=$(curl -H "Content-Type: application/json" \
-X POST --data "{ \"client_id\": \"${{ inputs.username }}\", \
\"client_secret\": \"${{ inputs.password }}\" }" \
${{ inputs.url }}/api/v1/authenticate | tr -d '"')
curl -H "Content-Type: application/json" \
-X POST -H "Authorization: Bearer ${XRAY_TOKEN}" \
--data @"${{ inputs.json }}" \
${{ inputs.url }}/api/v1/import/execution/cucumber
13 changes: 12 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
runs-on: ubuntu-latest
env:
REPORTS_DIR: "tests/e2e-tests/target/site/serenity"
XRAY_EXECUTION_TAG_LOCALHOST: "@ATL-3853"
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -109,7 +110,17 @@ jobs:
./gradlew test --tests "E2eTestsRunner" || true
./gradlew reports

- uses: actions/upload-artifact@v2
- name: Update X-Ray test execution
uses: ./.github/actions/upload-to-xray
# if: github.ref_name == 'main'
with:
username: ${{ secrets.XRAY_CLIENT_ID }}
password: ${{ secrets.XRAY_CLIENT_SECRET }}
json: "tests/e2e-tests/target/serenity-reports/cucumber_report.json"
execution_tag: ${{ env.XRAY_EXECUTION_TAG_LOCALHOST }}

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: e2e-tests-result
path: ${{ env.REPORTS_DIR }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@RFC0160 @AIP10
Feature: Agents connection

@TEST_ATL-3834
Scenario: Establish a connection between two agents
When Acme generates a connection invitation to Bob
And Bob receives the connection invitation from Acme
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,14 @@
@schemas
Feature: Credential schemas

Scenario: Successful schema creation
When Acme creates a new credential schema
Then He sees new credential schema is available

Scenario Outline: Multiple schema creation
When Acme creates <schemas> new schemas
Then He can access all of them one by one
Examples:
| schemas |
| 4 |

#Scenario Outline: Wrong specified fields for schema generation requests should fail
# When Acme tries to create a new schema with <value> in field <field>
# Then He sees the request with status <status>
#Examples:
# | field | value | status |
# | id | -1 | 400 |
# | attributes | null | 400 |
#
#@skip
#Scenario: Schema creation with identical name should fail
#
#@skip @bug
#Scenario: Schema creation with identical id should fail
# When Acme creates a new schema with some id
# And Acme tries to create a new schema with identical id
# Then He sees the request failure with identical id error

#Scenario Outline: Wrong specified fields for schema generation requests should fail
# When Acme tries to create a new schema with <value> in field <field>
# Then He sees the request with status <status>
#Examples:
# | field | value | status |
# | name | null | 400 |
# | version | null | 400 |
# | schema | null | 400 |
#
#@skip @bug
#Scenario Outline: Using incorrect filter params should result in error
# When Acme tries to get schemas with <value> in parameter <parameter>
# Then He sees the request with status <status>
#Examples:
# | parameter | value | status |
# | limit | -1 | 400 |
# | offset | -1 | 400 |
# | offset | 1000000 | 400 |
@TEST_ATL-3835
Scenario: Successful schema creation
When Acme creates a new credential schema
Then He sees new credential schema is available

@TEST_ATL-3836
Scenario Outline: Multiple schema creation
When Acme creates <schemas> new schemas
Then He can access all of them one by one
Examples:
| schemas |
| 4 |
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Feature: Create DID

@TEST_ATL-3838
Scenario: Create PRISM DID
When Acme creates PRISM DID
Then He sees PRISM DID was created successfully

@TEST_ATL-3839
Scenario Outline: PRISM DID creation fails when required request fields are missing
Given Acme tries to create PRISM DID with missing <field>
Then He sees the request has failed with error status <error>
Expand All @@ -18,6 +20,7 @@ Examples:
| documentTemplate.services[0].type | 400 |
| documentTemplate.services[0].serviceEndpoint | 400 |

@TEST_ATL-3840
Scenario Outline: PRISM DID creation fails with wrong formatted fields
Given Acme tries to create a managed DID with value <value> in <field>
Then He sees the request has failed with error status <error>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@DLT
Feature: Deactivate DID

@TEST_ATL-3837
Scenario: Deactivate DID
Given Acme have published PRISM DID
When Acme deactivates PRISM DID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Feature: DID listing

@TEST_ATL-3841
Scenario: Listing multiple PRISM DIDs
Given Acme creates 5 PRISM DIDs
When He lists all PRISM DIDs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@DLT
Feature: Publish DID

@TEST_ATL-3842
Scenario: Successfully publish DID to ledger
Given Acme creates unpublished DID
When He publishes DID to ledger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
@DLT
Feature: Update DID

Background:
Background: Published DID is created
#@PRECOND_ATL-3843
Given Acme have published PRISM DID

@TEST_ATL-3844
Scenario: Update PRISM DID by adding new services
When Acme updates PRISM DID with new services
And He submits PRISM DID update operation
Then He sees PRISM DID was successfully updated with new services

@TEST_ATL-3845
Scenario: Update PRISM DID by removing services
When Acme updates PRISM DID by removing services
And He submits PRISM DID update operation
Then He sees PRISM DID was successfully updated by removing services

@TEST_ATL-3846
Scenario: Update PRISM DID by updating services
When Acme updates PRISM DID by updating services
And He submits PRISM DID update operation
Then He sees PRISM DID was successfully updated by updating services

@TEST_ATL-3847
Scenario: Update PRISM DID by adding new keys
When Acme updates PRISM DID by adding new keys
And He submits PRISM DID update operation
Then He sees PRISM DID was successfully updated with new keys

@TEST_ATL-3848
Scenario: Update PRISM DID by removing keys
When Acme updates PRISM DID by removing keys
And He submits PRISM DID update operation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@RFC0453 @AIP20
Feature: Issue Credentials Protocol

@TEST_ATL-3849
Scenario: Issuing credential with published PRISM DID to unpublished PRISM DID
Given Acme and Bob have an existing connection
When Acme creates unpublished DID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@AIP20 @RFC0037
Feature: Present Proof Protocol

@TEST_ATL-3850
Scenario: Holder presents credential proof to verifier
Given Faber and Bob have an existing connection
And Bob has an issued credential from Acme
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@system @smoke
Feature: Agent Health Endpoint

@TEST_ATL-3833
Scenario: The runtime version can be retrieved from the Health Endpoint
When Acme makes a request to the health endpoint
Then Acme knows what version of the service is running
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python

# pylint: disable=import-error
import click
import json


@click.command()
@click.argument('file_path', type=click.Path(exists=True))
@click.argument('new_tag')
def add_tag(file_path, new_tag):
# read the JSON object from the file
with open(file_path, 'r') as file:
json_obj = json.load(file)

# add the new tag to the "tags" field of each scenario
for scenario in json_obj[0]["elements"]:
scenario["tags"].append({"name": new_tag})

# write the updated JSON object back to the file
with open(file_path, 'w') as file:
json.dump(json_obj, file)

# print a message to indicate that the operation is complete
click.echo(f'The "{new_tag}" tag has been added to "{file_path}".')


if __name__ == '__main__':
# pytlint: disable=no-value-for-parameter
add_tag()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
click==8.1.3