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

Add ui unit test and Merge UI constants and AGA constants #168

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

tianyuanzoe
Copy link
Contributor

@tianyuanzoe tianyuanzoe commented Dec 6, 2024

Description

Adding unit test for Autogluon-Assistant UI and Merge UI constants and AGA constants

How Has This Been Tested?

  • Unit tests (pytest tests/)
  • Integration tests (if applicable)

Configuration Changes

  • No config changes
  • Config changes (please describe):

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code cleanup/refactor

@tianyuanzoe tianyuanzoe marked this pull request as ready for review December 7, 2024 00:04
@tianyuanzoe tianyuanzoe changed the title add ui unit test [WIP]add ui unit test Dec 8, 2024
Copy link
Collaborator

@AnirudhDagar AnirudhDagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianyuanzoe Two high level comments other than the import specific comments which are causing tests failures:

  1. Please move the tests into the root tests dir under ui (you will need to create this directory): tests/unittests/ui/<test_name.py, ...>
  2. [Not directly related to this PR] Please consider combining the constants.py file in the UI and the https://github.com/autogluon/autogluon-assistant/blob/main/src/autogluon/assistant/constants.py

from unittest.mock import MagicMock, Mock, patch

import pytest
from constants import PRESET_MAPPING
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use complete imports like, currently if we run the tests it fails:

from autogluon.assistant.constants import TEST, TRAIN

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianyuanzoe how did you run the tests on your local machine ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python -m pytest tests/unittests/ui
and it all passed
image

src/autogluon/assistant/ui/tests/test_task_func.py Outdated Show resolved Hide resolved
src/autogluon/assistant/ui/tests/test_task_widget.py Outdated Show resolved Hide resolved
src/autogluon/assistant/ui/pages/task.py Outdated Show resolved Hide resolved
Copy link

@prateekdesai04 prateekdesai04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide a short doc string on what each test does and try to add coverage

from unittest.mock import MagicMock, Mock, patch

import pytest
from constants import PRESET_MAPPING

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianyuanzoe how did you run the tests on your local machine ?

@prateekdesai04
Copy link

@tianyuanzoe please change the CI files to add your tests, currently I am not able to see any CI runs.
You can merge the current PR along with changes in CI files and you should be able to see them on the CI runs which means you can test them, followed by which you can put follow-up PR to fix these tests as they will fail on the initial merge.

@suzhoum
Copy link
Contributor

suzhoum commented Dec 19, 2024

/platform_tests 4a9b9ee
Platform Tests Output

@tianyuanzoe tianyuanzoe changed the title [WIP]add ui unit test Add ui unit test Dec 20, 2024
@prateekdesai04
Copy link

prateekdesai04 commented Dec 20, 2024

@tianyuanzoe thanks for making the changes, have you made sure if they work in the github CI ?
https://github.com/tianyuanzoe/autogluon-assistant/actions/runs/12423970485 I still see some failures here

@tianyuanzoe tianyuanzoe changed the title Add ui unit test Add ui unit test and Merge UI constants and AGA constants Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants