Run automated tests on buildbot #69541

Closed
opened 2019-09-05 15:09:49 +02:00 by Brecht Van Lommel · 14 comments

Automated tests were enabled on buildbot.

    • Failure to pass tests should stop the build from being made available for download. We can do this after we verified tests are passing reliably.
    • Automated testing with asserts and address sanitizer?
    • Cycles GPU testing
    • Eevee/Workbench GPU testing
Automated tests were enabled on buildbot. * - [x] Failure to pass tests should stop the build from being made available for download. We can do this after we verified tests are passing reliably. * - [ ] Setup [notifications ](http://docs.buildbot.net/current/manual/configuration/reporters/index.html) for when buildbot master builds fail * - [ ] Automated testing with asserts and address sanitizer? * - [ ] Cycles GPU testing * - [ ] Eevee/Workbench GPU testing
Author
Owner

Added subscriber: @brecht

Added subscriber: @brecht
Author
Owner

Currently tests are only working on Linux. The issue is that the buildbot installs Blender to a directory separate from the build directory. However the tests run Blender from the build directory, and then will miss the Python executable on Windows and OpenMP library on macOS.

We need to either make the tests run from the install directory, or install Blender to the build directory.

Currently tests are only working on Linux. The issue is that the buildbot installs Blender to a directory separate from the build directory. However the tests run Blender from the build directory, and then will miss the Python executable on Windows and OpenMP library on macOS. We need to either make the tests run from the install directory, or install Blender to the build directory.

This issue was referenced by 2028302f44

This issue was referenced by 2028302f4433910dc0841c4033b951275fa3f678
Author
Owner

Tests are now passing on al platforms after 2028302f44 and some additional fixes.

Tests are now passing on al platforms after 2028302f44 and some additional fixes.
Author
Owner

It seems builds are still being uploaded if tests fail.

It seems builds are still being uploaded if tests fail.
Member

Added subscriber: @Calra

Added subscriber: @Calra
Member

From the discussion on blender chat, the notifications for failed build can be sent to #blender-coders. Help code snippet which will/can be used:

import requests
import json
url = 'https://blender.chat/api/v1/chat.sendMessage'
# 9p9NPvT7yFseE8ivA = #blender-coders you can get this from /api/v1/channels.list endpoint
payload = { 'message' : { 'rid' : '9p9NPvT7yFseE8ivA', 'msg' : 'test message' }}
# You get both the token and user-id from the personal access token section of the user settings.
headers = {'content-type': 'application/json',
'X-Auth-Token' : 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'X-User-Id' : 'xxxxxxxxxxxxxxxxx'
}

r = requests.post(url, data=json.dumps(payload), headers=headers)
print(r.content)```
From the discussion on blender chat, the notifications for failed build can be sent to `#blender-coders`. Help code snippet which will/can be used: ```# rest api documented here https://docs.rocket.chat/api/rest-api import requests import json url = 'https://blender.chat/api/v1/chat.sendMessage' # 9p9NPvT7yFseE8ivA = #blender-coders you can get this from /api/v1/channels.list endpoint payload = { 'message' : { 'rid' : '9p9NPvT7yFseE8ivA', 'msg' : 'test message' }} # You get both the token and user-id from the personal access token section of the user settings. headers = {'content-type': 'application/json', 'X-Auth-Token' : 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'X-User-Id' : 'xxxxxxxxxxxxxxxxx' } r = requests.post(url, data=json.dumps(payload), headers=headers) print(r.content)```
Member

Hey @brecht I am kind of getting stuck, could you give some insight?

  • since they already provide a lot of Reporters (bots) I kind of can't seem to figure out how exactly is the build status being conveyed?
  • am thinking of creating an instance of StatusBot class and extracting the build information from there? as that is the base class being used by the [IRC]] and [ https:*github.com/buildbot/buildbot/blob/e882d79d71161e471fb63355048f93d4e8c65f96/master/buildbot/reporters/telegram.py | Telegram bot
  • not sure if there is an obviously easy way, which I can't seem to find?
    I also had a few design questions.
  • we want a simple report failed test status bot?
  • Not an interactive one? (start build/ stop build etc) or that could be a long term goal?
    Using it on IRC was simple
    image.png
Hey @brecht I am kind of getting stuck, could you give some insight? * since they already provide a lot of Reporters (bots) I kind of can't seem to figure out how exactly is the build status being conveyed? * am thinking of creating an instance of `StatusBot` class and extracting the build information from there? as that is the base class being used by the [IRC]] and [[ https:*github.com/buildbot/buildbot/blob/e882d79d71161e471fb63355048f93d4e8c65f96/master/buildbot/reporters/telegram.py | Telegram](https:*github.com/buildbot/buildbot/blob/a0e1d8840e8856ead136a1ad6e2021931355af15/master/buildbot/reporters/irc.py) bot * not sure if there is an obviously easy way, which I can't seem to find? I also had a few design questions. * we want a simple report failed test status bot? * Not an interactive one? (start build/ stop build etc) or that could be a long term goal? Using it on IRC was simple ![image.png](https://archive.blender.org/developer/F9593960/image.png)
Author
Owner

The functionality I would expect is just a message whenever a build fails. And then perhaps that could be made a bit smarter to group together results from different platforms, filter out reports from the custom branch builder, not report consecutive build failures if it's too noisy, etc. Whatever we find out is a good signal to noise ratio in practice. Maybe just showing every failed build for every platform is fine.

I don't think the bot has to be interactive. It doesn't really solve a problem we have as far as I know, and would mean more maintenance and things that can break. If we do, then StatusBot would make sense since it provides that kind of functionality.

But for our purposes, just subclassing HttpStatusPush seems enough, as is done for the Hipchat bot for example?

The functionality I would expect is just a message whenever a build fails. And then perhaps that could be made a bit smarter to group together results from different platforms, filter out reports from the custom branch builder, not report consecutive build failures if it's too noisy, etc. Whatever we find out is a good signal to noise ratio in practice. Maybe just showing every failed build for every platform is fine. I don't think the bot has to be interactive. It doesn't really solve a problem we have as far as I know, and would mean more maintenance and things that can break. If we do, then `StatusBot` would make sense since it provides that kind of functionality. But for our purposes, just subclassing `HttpStatusPush` seems enough, as is done for the Hipchat bot for example?
Member

Hey @brecht I looked into HttpStatusPush, it seems apt for our use case.

I made one BlenderChatStatusPush subclassing HttpStatusPush. Here is what all I tried:

  • Directly trying to use HttpStatusPush to send some message to Blender Chat, from the documentation, it says it returns JSON object.

  • For the generator parameter, I created an object of BuildStatusGenerator class, with mode="all"

  • For user and password I used my Blender Chat user ID and authorization token.

  • Subclassing HttpStatusPush and trying to make some changes to the sendMessage, configService and reconfigService method

  • Explicitly calling sendMessage method but then it requires other parameters like build
    Here is my understanding, correct me if I am wrong

  • All build information is passed internally, we don't need to provide the builder name explicitly (as the IRC bot already had all this info)

I didn't have much success with sending the status to blender.chat or rather any message using the reporter.

  • Thinking HttpClientService is not receiving proper parameters to make a post request?

I couldn't use Hipchat api to test it, Hipchat has been shutdown, also Hipchat used HttpStatusPushBase which had been deprecated, I mostly toyed around with HttpStatusPush. Could you look into this?
Thanks

Hey @brecht I looked into `HttpStatusPush`, it seems apt for our use case. I made one `BlenderChatStatusPush` subclassing `HttpStatusPush`. Here is what all I tried: * Directly trying to use `HttpStatusPush` to send some message to Blender Chat, from the documentation, it says it returns JSON object. * For the `generator` parameter, I created an object of `BuildStatusGenerator` class, with `mode="all"` * For `user` and `password` I used my Blender Chat user ID and authorization token. * Subclassing `HttpStatusPush` and trying to make some changes to the `sendMessage`, `configService` and `reconfigService` method * Explicitly calling `sendMessage` method but then it requires other parameters like `build` Here is my understanding, correct me if I am wrong * All build information is passed internally, we don't need to provide the builder name explicitly (as the IRC bot already had all this info) I didn't have much success with sending the status to blender.chat or rather any message using the reporter. * Thinking `HttpClientService` is not receiving proper parameters to make a post request? I couldn't use Hipchat api to test it, Hipchat has been shutdown, also Hipchat used `HttpStatusPushBase` which had been deprecated, I mostly toyed around with `HttpStatusPush`. Could you look into this? Thanks
Author
Owner

The authorization token is not an HTTP password and can't be used as such. The user and token need to be put in the header as in the code snippet.

Subclassing just HttpStatusPushBase may be enough. You don't even have to use httpclientservice, using requests as in the code snippet instead is probably fine.

You need to implement the send method (not sendMessage), and convert the build object it receives into a human-readable text message.

The authorization token is not an HTTP password and can't be used as such. The user and token need to be put in the header as in the code snippet. Subclassing just `HttpStatusPushBase` may be enough. You don't even have to use `httpclientservice`, using `requests` as in the code snippet instead is probably fine. You need to implement the `send` method (not `sendMessage`), and convert the `build` object it receives into a human-readable text message.
Member

In #69541#1103566, @brecht wrote:
The authorization token is not an HTTP password and can't be used as such. The user and token need to be put in the header as in the code snippet.

Yes, I passed the authorization token and user id in the headers as well.

Subclassing just HttpStatusPushBase may be enough. You don't even have to use httpclientservice, using requests as in the code snippet instead is probably fine.

Yes, this was my first approach, I tried directly using post method of requests and attempted to send a message to myself on blender.chat inside both send/sendMessage method (separately).

You need to implement the send method (not sendMessage), and convert the build object it receives into a human-readable text message.

I realized this after already commenting, I was implementing it in the wrong method. I will try it again.

> In #69541#1103566, @brecht wrote: > The authorization token is not an HTTP password and can't be used as such. The user and token need to be put in the header as in the code snippet. Yes, I passed the authorization token and user id in the headers as well. > Subclassing just `HttpStatusPushBase` may be enough. You don't even have to use `httpclientservice`, using `requests` as in the code snippet instead is probably fine. Yes, this was my first approach, I tried directly using `post` method of `requests` and attempted to send a message to myself on blender.chat inside both `send/sendMessage` method (separately). > You need to implement the `send` method (not `sendMessage`), and convert the `build` object it receives into a human-readable text message. I realized this after already commenting, I was implementing it in the wrong method. I will try it again.

Added subscriber: @ponderz

Added subscriber: @ponderz
Philipp Oeser removed the
Interest
Platforms, Builds & Tests
label 2023-02-10 08:58:25 +01:00
Author
Owner

Moved to infrastructure/blender-projects-platform#47 and infrastructure/blender-projects-platform#46.

It's unfortunate the rocket chat integration was implemented but never deployed. However it seems less necessary now with the direct integration of CI status on projects.blender.org.

Moved to infrastructure/blender-projects-platform#47 and infrastructure/blender-projects-platform#46. It's unfortunate the rocket chat integration was implemented but never deployed. However it seems less necessary now with the direct integration of CI status on projects.blender.org.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-02-27 18:17:35 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#69541
No description provided.