Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.

License

NotificationsYou must be signed in to change notification settings

mikepenz/xray-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

:octocat:

... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.



Setup 🛠️Contribute 🧬License 📓


Setup

Configure the workflow

Specify the action as part of your GitHub actions workflow, using aXray API key (i.e. a pair of client id and client secret):

Xray Cloud

-name:"Import results to Xray"uses:mikepenz/xray-action@{latest-release}with:username:${{ secrets.XRAY_CLIENT_ID }}password:${{ secrets.XRAY_CLIENT_SECRET }}testFormat:"junit"testPaths:"**/test/*.xml"testExecKey:"TEST-1"projectKey:"TEST"

Xray Server/DC

If you're using Xray Server/DC, you'll need to setxrayCloud as "false", use Jira credentials for authentication, and specify additional parameters.

-name:"Import results to Xray"uses:mikepenz/xray-action@{latest-release}with:username:${{ secrets.JIRA_USERNAME }}password:${{ secrets.JIRA_PASSWORD }}xrayCloud:"false"xrayBaseUrl:"https://myjiraserver.example.com"testFormat:"junit"testPaths:"**/test/*.xml"testExecKey:"TEST-1"projectKey:"TEST"importRetryLimit:"5"# Retry up to 5 times on failureresponseTimeout:"120000"# 2 minutes timeout

⚠️ Xray Server/DC requirestest plan,test env,revision to be defined via their custom field. See additional details on passing a customtest execution json.

💡 Do not specify username and password in cleartext, instead prefer to read them from GitHub action secrets.

InputDescriptionRequired
xrayCloudDefines which variant of Xray to target [cloud vs Server/DC] (default="true")
xrayBaseUrlDefines the base URL for Xray Server/DC, could be used to change XRay Data region for XRay Cloud (required if xrayCloud="false")x*
usernameXray API client id (cloud) or Jira username (Server/DC). (Required for xrayCloud)x*
passwordXray API client secret (cloud) or Jira password (Server/DC). (Required for xrayCloud)x*
xrayTokenXray Personal Access Token. If provided username/password are ignored. (Xray Server/DC only)
testFormatDescribes the import formats ["xray", "cucumber", "behave", "junit", "testng", "nunit", "xunit", "robot", "bundle"]x
testPathsGlob expression to report paths. The default is**/junit-reports/TEST-*.xml.x
testMergeMerges together multiple test report files into a single report. Supported for: ["junit", "cucumber"]. (Default: true)
testExecKeyKey of the Test Executionx
projectKeyKey of the project where the Test Execution (if the testExecKey parameter wasn't provided) and the tests (if they aren't created yet) are going to be created.x
testPlanKeyKey of the Test Plan; if you specify the Test Plan, the Tests will be added automatically to the Test Plan if they're not part of it.
testEnvironmentsA string containing a list of test environments separated by ";"
revisionSource code and documentation version used in the test execution.
fixVersionThe Fix Version associated with the test execution (it supports only one value).
combineInSingleTestExecIf notestExecKey is provided, it will generate a testExec with the first import, and reuse the same for all other imports. (Default: false)
failOnImportErrorDefines if the action should fail if an import error occurred. (Default: false)
continueOnImportErrorDefines if the action should continue after a single import error occurred. (Default: true)
importParallelismSpecifies the level of parallelism to import to Xray. (Default: 2)
responseTimeoutSpecifies the maximum duration for a request (in milliseconds) to wait for a response to execute before timing out. The default is 60000 milliseconds.
importRetryLimitSpecifies the maximum number of retries for failed import requests. The default is 2.
testExecutionJsonFile path to a json file, containing the meta information to create the xray test execution ticket.
testJsonFile path to a json file, containing the meta information to create the xray test ticket.

Test execution json

The test execution json should the meta information in the following format:

Xray Cloud

{"fields": {"summary":"Brand new Test execution","issuetype": {"id":"10007" },"components": [            {"name":"Interface" },            {"name":"Core" }        ]    }}

Xray Server/DC

⚠️ For Xray Server/DC environmentstest plan,test env,revision fields are required to be provided via their custom field. See theofficial API documentation for more details.

{"fields": {"summary":"Brand new Test execution","issuetype": {"id":"10007" },"components" : [            {"name":"Interface" },            {"name":"Core" }        ],"customfield_10032" : ["TES-38"        ]    }}

💡 The import will fail if the provided issueType for example does not exist. Please ensure correct information is provided.

Action outputs

After action execution it will return helpful information.

# ${{steps.{XRAY_STEP_ID}.outputs.count}}${{steps.xray.outputs.count}}

A full set list of possible output values for this action.

OutputDescription
countThe count of imported files.
completedThe count of completed imports.
failedThe count of failed imports.
errorMessageThe message of failed imports.
errorStatusCodeThe status code of failed imports.
testExecKeyThe key of the created test execution.

Contribute 🧬

# Install the dependencies$ npm install# Build the typescript and package it for distribution$ npm run build&& npm run package# Run the tests, use to debug, and test it out# Please note you have to uncomment the test# Provide your xray instance username and password# And then execute the test:$ npmtest# Verify lint is happy$ npm run lint -- --fix

Xray

Developed By

Other actions

License

Copyright 2025 Mike PenzLicensed 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.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.

About

... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp