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

Duplicate history trends #110

Closed
apulverizer opened this issue Jul 27, 2020 · 12 comments
Closed

Duplicate history trends #110

apulverizer opened this issue Jul 27, 2020 · 12 comments
Labels
bug Something isn't working fixed Fixed released Released

Comments

@apulverizer
Copy link
Contributor

apulverizer commented Jul 27, 2020

It seems like the history trend is invalid.

Here is a simple repro case using the sample data:

  1. In the allure-api-usage directory call python send_results.py
  2. In the hosted api run generate-report on the default project

After a single test run I'm seeing a trend chart like:

Notice there are two entries for #1 this seems invalid.

Running allure server allure-results-example/ locally renders it like:
image
which is what I expect to see.

It seems like the history is getting duplicated somehow.

Logs:

Starting reporting_allure_1 ... done
Attaching to reporting_allure_1
allure_1  | Not checking results automatically
allure_1  | ALLURE_VERSION: 2.13.4
allure_1  | Generating default report
allure_1  | ls: cannot access '/app/allure-docker-api/static/projects/default/reports': No such file or directory
allure_1  | Creating results directory for PROJECT_ID: default
allure_1  | Creating executor.json for PROJECT_ID: default
allure_1  | Generating report for PROJECT_ID: default
allure_1  | Report successfully generated to /app/allure-docker-api/static/projects/default/reports/latest
allure_1  | Status: 200
allure_1  | 2020-07-27 17:27:33.819:INFO::main: Logging initialized @699ms to org.eclipse.jetty.util.log.StdErrLog
allure_1  | Creating history on results directory for PROJECT_ID: default ...
allure_1  | Copying history from previous results...
allure_1  | Status: 200

This is my compose file:

version: '3'
services:
  allure:
    image: "frankescobar/allure-docker-service"
    environment:
      CHECK_RESULTS_EVERY_SECONDS: NONE
      KEEP_HISTORY: "TRUE"
      KEEP_HISTORY_LATEST: 25
    ports:
      - "5050:5050"
    volumes:
      - ${PWD}/projects:/app/projects
@fescobar
Copy link
Owner

fescobar commented Jul 28, 2020

@apulverizer yes, it's duplicated the #1 execution but there is no results. It didn't affect your metrics. you see twice but both have no results.
It's a minor bug. Only happened with the first execution.
I will try to fix it later. Thanks

@fescobar fescobar added answered Question answered bug Something isn't working minor minor bug labels Jul 28, 2020
@apulverizer
Copy link
Contributor Author

Thanks for looking into it @fescobar However, I don't think it only happens on the first execution. It seems to be on every execution.

  1. Create new project using create-project api
  2. Clear local allure-results directory
  3. Run behave test with allure formatter
  4. Upload results via the send-results api
  5. Generate report via generate-report api

image

  1. Clear results via clean-results api
  2. Clear local allure-results directory
  3. Run behave test with allure formatter
  4. Upload new results via the send-results api
  5. Generate report via generate-report api

image

You can see there are 2 entries for both #1 and #2 same thing after more executions.
image

@fescobar
Copy link
Owner

fescobar commented Jul 28, 2020

@apulverizer you are already using CHECK_RESULTS_EVERY_SECONDS: 1. You need to restart the server to apply the config CHECK_RESULTS_EVERY_SECONDS: NONE

When you clean your results, the files automatically are detected, then execute generate-report. For that reason you have to apply correctly NONE

docker-compose down

delete all your local folders, after that

docker-compose up

@apulverizer
Copy link
Contributor Author

@fescobar yeah that's what I did.

  1. docker-compose down to stop the server
  2. Manually delete all the projects in the mounted volume ${PWD}/projects
  3. docker-compose up (which includes setting CHECK_RESULTS_EVERY_SECONDS: NONE)
  4. Then all of the steps listed in my previous comment

In the servers logs I only see the intentionally triggered reports. I still see the duplicate results though.

@fescobar
Copy link
Owner

fescobar commented Jul 28, 2020

@apulverizer can you attach logs?
Also, you don't need to request GET /generate-report after GET /clean-results

  1. Add tests files POST /send-results
  2. GET /generate-report
  3. GET /clean-results
  4. Add tests files POST /send-results again
  5. GET /generate-report again

@apulverizer
Copy link
Contributor Author

Okay so here's the logs for staring with a clean projects directory, then running a test, uploading files, and generating the report (3 times)

Server Logs:

Starting reporting_allure_1 ... done
Attaching to reporting_allure_1
allure_1  | Not checking results automatically
allure_1  | ALLURE_VERSION: 2.13.4
allure_1  | Generating default report
allure_1  | ls: cannot access '/app/allure-docker-api/static/projects/default/reports': No such file or directory
allure_1  | Creating results directory for PROJECT_ID: default
allure_1  | Creating executor.json for PROJECT_ID: default
allure_1  | Generating report for PROJECT_ID: default
allure_1  | Report successfully generated to /app/allure-docker-api/static/projects/default/reports/latest
allure_1  | Status: 200
allure_1  | 2020-07-28 16:43:24.040:INFO::main: Logging initialized @650ms to org.eclipse.jetty.util.log.StdErrLog
allure_1  | Creating history on results directory for PROJECT_ID: tracker-firefox-ui-test ...
allure_1  | Status: 200
allure_1  | Cleaning results for PROJECT_ID: tracker-firefox-ui-test
allure_1  | Creating history on results directory for PROJECT_ID: tracker-firefox-ui-test ...
allure_1  | Copying history from previous results...
allure_1  | Creating executor.json for PROJECT_ID: tracker-firefox-ui-test
allure_1  | Generating report for PROJECT_ID: tracker-firefox-ui-test
allure_1  | Report successfully generated to /app/allure-docker-api/static/projects/tracker-firefox-ui-test/reports/latest
allure_1  | Status: 200
allure_1  | Creating history on results directory for PROJECT_ID: tracker-firefox-ui-test ...
allure_1  | Copying history from previous results...
allure_1  | Status: 200
allure_1  | Cleaning results for PROJECT_ID: tracker-firefox-ui-test
allure_1  | Creating history on results directory for PROJECT_ID: tracker-firefox-ui-test ...
allure_1  | Copying history from previous results...
allure_1  | Creating executor.json for PROJECT_ID: tracker-firefox-ui-test
allure_1  | Generating report for PROJECT_ID: tracker-firefox-ui-test
allure_1  | Report successfully generated to /app/allure-docker-api/static/projects/tracker-firefox-ui-test/reports/latest
allure_1  | Status: 200
allure_1  | Creating history on results directory for PROJECT_ID: tracker-firefox-ui-test ...
allure_1  | Copying history from previous results...
allure_1  | Status: 200

Test Run 1 Response Logs:

  1. Check for projects
  2. Create a new project
  3. Send Results
  4. Generate Report
[2020-07-28 12:44:26,960] [67506] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'projects': {'default': {'uri': 'http://localhost:5050/allure-docker-service/projects/default'}}}, 'meta_data': {'message': 'Projects successfully obtained'}}
[2020-07-28 12:44:26,976] [67506] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'id': 'tracker-firefox-ui-test'}, 'meta_data': {'message': 'Project successfully created'}}
[2020-07-28 12:44:27,062] [67506] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'current_files': ['0600a2ca-29d3-44b3-9c3e-a17e5c2520eb-result.json', 'e5488dfa-4719-465a-b70f-74788de120cc-result.json', 'e71d9a4d-30c3-4ca0-8761-2ecd5879acf7-result.json', '54ef2aa3-7eda-4694-a701-3382f4cb7278-result.json', '47dc14e5-3ace-4f68-a93e-fc24cc12c9cc-result.json', 'f1a1507a-db52-446b-87cb-39a4f8e52912-result.json', '0acb06a0-ab9e-4186-a21a-beec2191a795-result.json', '5cf81972-ca9e-43ee-bd1c-5e6a17f3473a-result.json', 'environment.xml', '67397d28-d95f-4cb5-a1d2-eb89d5cc948d-result.json'], 'current_files_count': 10, 'failed_files': [], 'failed_files_count': 0, 'processed_files': ['0600a2ca-29d3-44b3-9c3e-a17e5c2520eb-result.json', 'e5488dfa-4719-465a-b70f-74788de120cc-result.json', 'e71d9a4d-30c3-4ca0-8761-2ecd5879acf7-result.json', '54ef2aa3-7eda-4694-a701-3382f4cb7278-result.json', '47dc14e5-3ace-4f68-a93e-fc24cc12c9cc-result.json', 'f1a1507a-db52-446b-87cb-39a4f8e52912-result.json', '0acb06a0-ab9e-4186-a21a-beec2191a795-result.json', '5cf81972-ca9e-43ee-bd1c-5e6a17f3473a-result.json', 'environment.xml', '67397d28-d95f-4cb5-a1d2-eb89d5cc948d-result.json'], 'processed_files_count': 10, 'sent_files_count': 10}, 'meta_data': {'message': "Results successfully sent for project_id 'tracker-firefox-ui-test'"}}
[2020-07-28 12:44:32,405] [67506] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'allure_results_files': ['0600a2ca-29d3-44b3-9c3e-a17e5c2520eb-result.json', 'e5488dfa-4719-465a-b70f-74788de120cc-result.json', 'e71d9a4d-30c3-4ca0-8761-2ecd5879acf7-result.json', '54ef2aa3-7eda-4694-a701-3382f4cb7278-result.json', '47dc14e5-3ace-4f68-a93e-fc24cc12c9cc-result.json', 'f1a1507a-db52-446b-87cb-39a4f8e52912-result.json', '0acb06a0-ab9e-4186-a21a-beec2191a795-result.json', '5cf81972-ca9e-43ee-bd1c-5e6a17f3473a-result.json', 'environment.xml', '67397d28-d95f-4cb5-a1d2-eb89d5cc948d-result.json'], 'report_url': 'http://localhost:5050/allure-docker-service/projects/tracker-firefox-ui-test/reports/1/index.html'}, 'meta_data': {'message': "Report successfully generated for project_id 'tracker-firefox-ui-test'"}}

I checked the report after this; it seemed correct (no history).
image

Test Run 2 Response Logs:

  1. Check for projects
  2. Clean Results
  3. Send Results
  4. Generate Report
[2020-07-28 12:46:33,828] [67553] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'projects': {'default': {'uri': 'http://localhost:5050/allure-docker-service/projects/default'}, 'tracker-firefox-ui-test': {'uri': 'http://localhost:5050/allure-docker-service/projects/tracker-firefox-ui-test'}}}, 'meta_data': {'message': 'Projects successfully obtained'}}
[2020-07-28 12:46:38,315] [67553] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'meta_data': {'message': "Results successfully cleaned for project_id 'tracker-firefox-ui-test'"}}
[2020-07-28 12:46:38,348] [67553] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'current_files': ['23ef7c55-2579-4e78-b00d-522f191b0e53-result.json', 'executor.json', 'b1ea31ce-2414-4cf0-b8be-dc6e10a6f643-result.json', '30f73496-6b52-4e07-95a3-ae9454a5fe6f-result.json', '103c3423-40b4-4144-813b-165db0ac717e-result.json', 'cfc25866-965a-40e3-bd29-95e5cd533506-result.json', '79e3aa4c-6de4-4981-9d35-af166c40e3c9-result.json', 'history', 'fafab9cf-b2f7-4006-991e-3bcdb6e63261-result.json', 'f2730097-75e1-4f84-8bf4-5fa1743bf537-result.json', 'a6f958cb-46c7-4950-811e-ed4a77801a82-result.json', 'environment.xml'], 'current_files_count': 12, 'failed_files': [], 'failed_files_count': 0, 'processed_files': ['23ef7c55-2579-4e78-b00d-522f191b0e53-result.json', 'b1ea31ce-2414-4cf0-b8be-dc6e10a6f643-result.json', '30f73496-6b52-4e07-95a3-ae9454a5fe6f-result.json', '103c3423-40b4-4144-813b-165db0ac717e-result.json', 'cfc25866-965a-40e3-bd29-95e5cd533506-result.json', '79e3aa4c-6de4-4981-9d35-af166c40e3c9-result.json', 'fafab9cf-b2f7-4006-991e-3bcdb6e63261-result.json', 'f2730097-75e1-4f84-8bf4-5fa1743bf537-result.json', 'a6f958cb-46c7-4950-811e-ed4a77801a82-result.json', 'environment.xml'], 'processed_files_count': 10, 'sent_files_count': 10}, 'meta_data': {'message': "Results successfully sent for project_id 'tracker-firefox-ui-test'"}}
[2020-07-28 12:46:44,358] [67553] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'allure_results_files': ['23ef7c55-2579-4e78-b00d-522f191b0e53-result.json', 'executor.json', 'b1ea31ce-2414-4cf0-b8be-dc6e10a6f643-result.json', '30f73496-6b52-4e07-95a3-ae9454a5fe6f-result.json', '103c3423-40b4-4144-813b-165db0ac717e-result.json', 'cfc25866-965a-40e3-bd29-95e5cd533506-result.json', '79e3aa4c-6de4-4981-9d35-af166c40e3c9-result.json', 'history', 'fafab9cf-b2f7-4006-991e-3bcdb6e63261-result.json', 'f2730097-75e1-4f84-8bf4-5fa1743bf537-result.json', 'a6f958cb-46c7-4950-811e-ed4a77801a82-result.json', 'environment.xml'], 'report_url': 'http://localhost:5050/allure-docker-service/projects/tracker-firefox-ui-test/reports/2/index.html'}, 'meta_data': {'message': "Report successfully generated for project_id 'tracker-firefox-ui-test'"}}

This contains duplicate entries in the history trend.
image

Test Run 3 Response Logs:

  1. Check for projects
  2. Clean Results
  3. Send Results
  4. Generate Report
[2020-07-28 12:48:56,766] [67714] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'projects': {'default': {'uri': 'http://localhost:5050/allure-docker-service/projects/default'}, 'tracker-firefox-ui-test': {'uri': 'http://localhost:5050/allure-docker-service/projects/tracker-firefox-ui-test'}}}, 'meta_data': {'message': 'Projects successfully obtained'}}
[2020-07-28 12:49:01,611] [67714] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'meta_data': {'message': "Results successfully cleaned for project_id 'tracker-firefox-ui-test'"}}
[2020-07-28 12:49:01,645] [67714] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'current_files': ['ed3bcc9d-e72e-4fcf-8317-631ecbba6f4c-result.json', '878be73e-d81f-4dcf-8927-d47b012edb4e-result.json', '9645d866-7318-4a9b-83a2-1bbbd1aa6cf4-result.json', 'executor.json', '7f76e2b0-e480-4f07-89c3-7ffaf35648e3-result.json', '3fba6778-cd7c-423a-ac00-6250e5fdf9e3-result.json', 'aab72595-0e71-4974-82d4-d98b817d00e1-result.json', 'history', 'eb0831ec-b849-4f71-893b-edbd6a16bd87-result.json', '44ea985c-78b9-434c-a99b-98c4cb18451a-result.json', 'f84cbb72-78a8-4d9b-81dc-a1afcb2bee83-result.json', 'environment.xml'], 'current_files_count': 12, 'failed_files': [], 'failed_files_count': 0, 'processed_files': ['ed3bcc9d-e72e-4fcf-8317-631ecbba6f4c-result.json', '878be73e-d81f-4dcf-8927-d47b012edb4e-result.json', '9645d866-7318-4a9b-83a2-1bbbd1aa6cf4-result.json', '7f76e2b0-e480-4f07-89c3-7ffaf35648e3-result.json', '3fba6778-cd7c-423a-ac00-6250e5fdf9e3-result.json', 'aab72595-0e71-4974-82d4-d98b817d00e1-result.json', 'eb0831ec-b849-4f71-893b-edbd6a16bd87-result.json', '44ea985c-78b9-434c-a99b-98c4cb18451a-result.json', 'f84cbb72-78a8-4d9b-81dc-a1afcb2bee83-result.json', 'environment.xml'], 'processed_files_count': 10, 'sent_files_count': 10}, 'meta_data': {'message': "Results successfully sent for project_id 'tracker-firefox-ui-test'"}}
[2020-07-28 12:49:06,909] [67714] [              allure_server.py:  13 -     _handle_response()]                     [MainThread] [multiproce] [   DEBUG] {'data': {'allure_results_files': ['ed3bcc9d-e72e-4fcf-8317-631ecbba6f4c-result.json', '878be73e-d81f-4dcf-8927-d47b012edb4e-result.json', '9645d866-7318-4a9b-83a2-1bbbd1aa6cf4-result.json', 'executor.json', '7f76e2b0-e480-4f07-89c3-7ffaf35648e3-result.json', '3fba6778-cd7c-423a-ac00-6250e5fdf9e3-result.json', 'aab72595-0e71-4974-82d4-d98b817d00e1-result.json', 'history', 'eb0831ec-b849-4f71-893b-edbd6a16bd87-result.json', '44ea985c-78b9-434c-a99b-98c4cb18451a-result.json', 'f84cbb72-78a8-4d9b-81dc-a1afcb2bee83-result.json', 'environment.xml'], 'report_url': 'http://localhost:5050/allure-docker-service/projects/tracker-firefox-ui-test/reports/3/index.html'}, 'meta_data': {'message': "Report successfully generated for project_id 'tracker-firefox-ui-test'"}}

Again, this has duplicate results:
image


I noticed in my code I was always cleaning results even if there weren't any. This was specifically happening after creating the project. Once I changed it to only clear results after a previous run, then at least the first test report was correct. But as noted above the subsequent ones have duplicates.

@fescobar fescobar added backlog Backlog and removed answered Question answered minor minor bug labels Jul 28, 2020
@fescobar
Copy link
Owner

@apulverizer you are right, I will fix soon.
Thank you so much for your feedback.

@fescobar fescobar added work in progress Work in progress and removed backlog Backlog labels Jul 29, 2020
fescobar added a commit that referenced this issue Jul 29, 2020
@fescobar
Copy link
Owner

@apulverizer can you check beta version? (remove beta version locally if you have a previous beta)

  allure:
    image: "frankescobar/allure-docker-service:beta"

I will be waiting for your feedback.

Thank you again.

@fescobar fescobar added testing Testing and removed work in progress Work in progress labels Jul 29, 2020
@apulverizer
Copy link
Contributor Author

The change looks good. Thanks for resolving this @fescobar

fescobar added a commit that referenced this issue Jul 29, 2020
@fescobar fescobar added ready to be released Ready to be released and removed testing Testing labels Jul 29, 2020
@fescobar
Copy link
Owner

@apulverizer I'm removing beta version. Version 2.13.5 was released with the fix. Please remove your local latest version and pull it again.
Thank you.

@fescobar fescobar added released Released and removed ready to be released Ready to be released labels Jul 29, 2020
@fescobar fescobar added the fixed Fixed label Jul 29, 2020
@apulverizer
Copy link
Contributor Author

Verified with version 2.13.5. Thanks for the quick turn-around @fescobar

@mr-possible
Copy link

I am facing this again in Single project mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Fixed released Released
Projects
None yet
Development

No branches or pull requests

3 participants