allure-framework / allure-teamcity

Teamcity CI plugin allowing to generate Allure Report as build artifact
https://qameta.io/allure-report
Apache License 2.0
37 stars 29 forks source link

Teamcity agent doesn't add allure to build runners #70

Closed LeoK80 closed 6 years ago

LeoK80 commented 6 years ago

[//]: # ( . Note: for support questions, please use Stackoverflow or Gitter. . This repository's issues are reserved for feature requests and bug reports. . . In case of any problems with Allure Jenkins plugin please use the following repository . to create an issue: https://github.com/jenkinsci/allure-plugin/issues . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )

I'm submitting a ...

What is the current behavior?

followed step as listed on the instructions:

  1. download the latest .zip file from bintray

  2. rename .zip file to 'allure-commandline.zip

  3. upload to Teamcity plugins through webUI

  4. restart Teamcity server to make it load new plugin

  5. Plugin is loaded with incorrect path structure inside the zip which should have teamcity-plugin.xml at very first level in the archive in order to be recognised as a plugin.

  6. After repackaging manually to an archive with structure as indicated below and uploading the plugin again it still won't run on the agent as the agent reports in the logs:

"WARN - jetbrains.buildServer.AGENT - Could not run Allure report generation because the Allure tool is not installed."

Directory structure on Server:

<teamcity_data>/plugins/allure-commandline.zip

and unpacked on server -->

<teamcity_data\>plugins/.unpacked/allure-commandline/
    agent/
        allure-commandline.zip
    server/
        allure-teamcity-common-2.6.jar
        allure-teamcity-server-2.6.jar
        commons-lang3-3.4.jar
    teamcity-plugin.xml

structure in main zip is same as unpacked structure above ^^

structure of `allure-commandline.zip inside the agent directory:

allure-commandline/
     lib/
        allure-teamcity-agent-2.6.jar
        allure-teamcity-common-2.6.jar
        commons-beanutils-1.8.0.jar
        commons-lang-2.5.jar
        ezmorph-1.0.6.jar
        json-lib-2.4-jdk15.jar
   teamcity-plugin.xml

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Please see followed steps above describing the current behaviour.

I pretty much followed the guide from allure framework docs and Teamcity doesn't manage to install the plugin correct out-of-the-box due to internal folder structure issues on the file downloadable from allure bintray zip file version 2.6.0.

Once you repackage the zip correctly with structures indicated as above (used other working plugins as templates) and install the plugin through the Teamcity WebUI, the agents will fail to run Allure due to Allure not being installed as indicated by the error from agent logs:

"WARN - jetbrains.buildServer.AGENT - Could not run Allure report generation because the Allure tool is not installed."

Because the agents are not being able to start Allure there will be no compatible agents to run any allure jobs as it won't have the required build runner for the build jobs to generate reports.

What is the expected behavior?

Expected behaviour:

  1. Download zip from bintray
  2. Rename allure-2.6.0.zip to allure-commandline.zip
  3. Upload plugin through teamcity server webUI
  4. Restart Teamcity server
  5. Plugin is available on server
  6. Plugin is started/added to build runners on the agents
  7. Start a job with a build step including Allure
  8. Being able to allocate compatible agents with allure build runner

What is the motivation / use case for changing the behavior?

It would be nice to have an out-of-the-box working Teamcity Plugin for Allure

Please tell us about your environment:

| Allure version | 2.6.0 | | Teamcity Server 10.0.5 | | Ubuntu SMP x64 |

Other information

[//]: # ( . e.g. detailed explanation, stacktraces, related issues, suggestions . how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc )

dkataskin commented 6 years ago

I think official instructions are misleading, I got the same problem as you when installing the plugin. Later I found correct path to get allure plugin working:

  1. download plugin from https://bintray.com/qameta/generic/allure-teamcity
  2. install it to plugins via web ui or manually == plugin will require allure command line tool to work so you need to install it to tools ==
  3. download allure-.zip from: https://bintray.com/qameta/generic/allure2
  4. rename allure-.zip to allure-commanline.zip
  5. install allure-commandline.zip to tools via web ui or manually

you should get allure plugin working.

rzinnatullin commented 6 years ago

Hi @dkataskin, you saved my day, thanks :)

Best regards, Rustem Zinnatullin.