Skip to content

Build: Fix restapi-sidecar docker Makefile#25417

Merged
lihuay merged 2 commits intosonic-net:masterfrom
nexthop-ai:nate.fix-docker-makefile
Feb 24, 2026
Merged

Build: Fix restapi-sidecar docker Makefile#25417
lihuay merged 2 commits intosonic-net:masterfrom
nexthop-ai:nate.fix-docker-makefile

Conversation

@nate-nexthop
Copy link
Copy Markdown
Contributor

Why I did it

Having this PHONY target results in unconditional builds. We should use the docker UT Schema to run the tests instead of doing it from the Makefile.

Note this was done for the telemetry sidecar here: #25122

Tests are run from here:

if [ -d $($*.gz_PATH)/cli-plugin-tests/ ] && [ ! "$(BUILD_SKIP_TEST)" = "y" ]; then pushd $($*.gz_PATH)/cli-plugin-tests; PATH=$(VIRTENV_BIN_CROSS_PYTHON$($(SONIC_UTILITIES_PY3)_PYTHON_VERSION)):${PATH} PYTHONPATH=$(shell realpath $($*.gz_PATH)):${PYTHONPATH} pytest-$($(SONIC_UTILITIES_PY3)_PYTHON_VERSION) -v $(LOG); popd; fi

Work item tracking
  • Microsoft ADO (number only):

How I did it

How to verify it

Test still runs when docker-restapi-sidecar is built:

Build start time: Tue Feb 10 19:15:36 UTC 2026
[ REASON ] :      target/docker-restapi-sidecar.gz does not exist   NON-EXISTENT PREREQUISITES: docker-start target/docker-config-engine-bookworm.gz-load target/python-wheels/bookworm/sonic_py_common-1.0-py3-none-any.whl-install target/debs/bookworm/libswsscommon_1.0.0_amd64.deb-install target/debs/bookworm/python3-swsscommon_1.0.0_amd64.deb-install target/debs/bookworm/python3-yang_1.0.73_amd64.deb-install
[ FLAGS  FILE    ] : []
[ FLAGS  DEPENDS ] : []
[ FLAGS  DIFF    ] : []
============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /sonic, configfile: pytest.ini
plugins: pyfakefs-5.10.2, cov-4.0.0
collecting ... collected 38 items

test_systemd_stub.py::test_sync_no_change_fast_path PASSED               [  2%]
test_systemd_stub.py::test_sync_updates_and_post_actions PASSED          [  5%]
test_systemd_stub.py::test_sync_missing_src_returns_false PASSED         [  7%]
test_systemd_stub.py::test_main_once_exits_zero_and_disables_post_actions PASSED [ 10%]
test_systemd_stub.py::test_env_controls_restapi_src_false PASSED         [ 13%]
<snip>
test_systemd_stub.py::test_per_branch_files_with_v1_flag[202311-True] PASSED [ 89%]
test_systemd_stub.py::test_per_branch_files_with_v1_flag[202405-True] PASSED [ 92%]
test_systemd_stub.py::test_per_branch_files_with_v1_flag[202411-True] PASSED [ 94%]
test_systemd_stub.py::test_per_branch_files_with_v1_flag[202505-True] PASSED [ 97%]
test_systemd_stub.py::test_per_branch_files_with_v1_flag[202511-True] PASSED [100%]

============================== 38 passed in 0.05s ==============================

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Having this PHONY target results in unconditional builds. We should use
the docker UT Schema to run the tests instead of doing it from the
Makefile.

Signed-off-by: Nate White <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nate-nexthop
Copy link
Copy Markdown
Contributor Author

@liushilongbuaa could you help review and merge please? This is basically the same as your PR #25122 but for a different container. Thanks!

@lguohan
Copy link
Copy Markdown
Collaborator

lguohan commented Feb 11, 2026

@qiluo-msft , review this one?

Copy link
Copy Markdown
Contributor

@liushilongbuaa liushilongbuaa left a comment

Choose a reason for hiding this comment

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

LGTM.
PY3_COMMON is already in dependency. LINK
test file is already in cli-plugin-tests folder. LINK

@lihuay lihuay merged commit 5425a55 into sonic-net:master Feb 24, 2026
26 checks passed
baxia-lan pushed a commit that referenced this pull request Feb 25, 2026
* Build: Fix restapi-sidecar docker Makefile (#25417)

Having this PHONY target results in unconditional builds. We should use
the docker UT Schema to run the tests instead of doing it from the
Makefile.

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Sonika Jindal <[email protected]>

* [azure-pipelines] Add alpinevs build pipeline

Signed-off-by: Sonika Jindal <[email protected]>

* Remove BUILD_MULTIASIC_KVM and INCLUDE_DHCP_SERVER from alpinevs build options

Signed-off-by: Sonika Jindal <[email protected]>

---------

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Sonika Jindal <[email protected]>
Co-authored-by: nate-nexthop <[email protected]>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
Having this PHONY target results in unconditional builds. We should use
the docker UT Schema to run the tests instead of doing it from the
Makefile.

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Feng Pan <[email protected]>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
* Build: Fix restapi-sidecar docker Makefile (sonic-net#25417)

Having this PHONY target results in unconditional builds. We should use
the docker UT Schema to run the tests instead of doing it from the
Makefile.

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Sonika Jindal <[email protected]>

* [azure-pipelines] Add alpinevs build pipeline

Signed-off-by: Sonika Jindal <[email protected]>

* Remove BUILD_MULTIASIC_KVM and INCLUDE_DHCP_SERVER from alpinevs build options

Signed-off-by: Sonika Jindal <[email protected]>

---------

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Sonika Jindal <[email protected]>
Co-authored-by: nate-nexthop <[email protected]>
Signed-off-by: Feng Pan <[email protected]>
dprital pushed a commit that referenced this pull request Mar 19, 2026
Having this PHONY target results in unconditional builds. We should use
the docker UT Schema to run the tests instead of doing it from the
Makefile.

Signed-off-by: Nate White <[email protected]>
Signed-off-by: dprital <[email protected]>
dprital pushed a commit that referenced this pull request Mar 19, 2026
* Build: Fix restapi-sidecar docker Makefile (#25417)

Having this PHONY target results in unconditional builds. We should use
the docker UT Schema to run the tests instead of doing it from the
Makefile.

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Sonika Jindal <[email protected]>

* [azure-pipelines] Add alpinevs build pipeline

Signed-off-by: Sonika Jindal <[email protected]>

* Remove BUILD_MULTIASIC_KVM and INCLUDE_DHCP_SERVER from alpinevs build options

Signed-off-by: Sonika Jindal <[email protected]>

---------

Signed-off-by: Nate White <[email protected]>
Signed-off-by: Sonika Jindal <[email protected]>
Co-authored-by: nate-nexthop <[email protected]>
Signed-off-by: dprital <[email protected]>
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.

5 participants