# How to configure junit to export results to Github (pytest)

**URL:** <https://community.jenkins.io/t/how-to-configure-junit-to-export-results-to-github-pytest/6994>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [April 23, 2023, 11:09am UTC](https://community.jenkins.io/t/how-to-configure-junit-to-export-results-to-github-pytest/6994 "2023-04-23T11:09:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raul-parada](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/raul-parada/32/3828_2.png) [@raul-parada](https://community.jenkins.io/u/raul-parada)\
**Post date:** [April 23, 2023, 11:09am UTC](https://community.jenkins.io/t/how-to-configure-junit-to-export-results-to-github-pytest/6994/1 "2023-04-23T11:09:01Z")

</div>

I have a pipeline which execute pytest tests, however, I would like to export the results in a xml file saved in Github (in the same location as the pytests).

```auto
pipeline {
    agent any

    stages {
        stage('Checkout') {
            steps {
                checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/raul-parada/Python-Selenium.git']])
            }
        }
        stage('Build') {
            steps {
                git branch: 'main', url: 'https://github.com/raul-parada/Python-Selenium.git'
                sh 'python3 test_calculator.py'
            }
        }
        stage('Test') {
            steps {
                sh 'python3 -m pytest'
            }
        }
        stage('Publish test results') {
            steps {
                junit 'https://github.com/raul-parada/Python-Selenium/*.xml'
            }
        }
    }
}

```

I got this error:

![image](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/7/76036ecdf457df98d1366388700739ad9b2972a8.png)

I have installed Junit plugin (by default).

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [April 23, 2023, 4:57pm UTC](https://community.jenkins.io/t/how-to-configure-junit-to-export-results-to-github-pytest/6994/2 "2023-04-23T16:57:49Z")

</div>

> [@raul-parada](#):
>
> ` junit 'https://github.com/raul-parada/Python-Selenium/*.xml'`

this takes in a path on the disk, not a url.  
my guess would be `junit '*.xml'`

> [@raul-parada](#):
>
> ` sh 'python3 -m pytest'`

also maybe `sh 'py.test --junitxml=result.xml test_calculator.py'`?

---

<div class="post-metadata">

**Author:** ![raul-parada](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/raul-parada/32/3828_2.png) [@raul-parada](https://community.jenkins.io/u/raul-parada)\
**Post date:** [April 23, 2023, 8:41pm UTC](https://community.jenkins.io/t/how-to-configure-junit-to-export-results-to-github-pytest/6994/3 "2023-04-23T20:41:35Z")

</div>

The first option gave me the same error and the second one passed the test but no xml was created
