-
Notifications
You must be signed in to change notification settings - Fork 109
Adding changes to run go test on dev environment #169
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
Adding changes to run go test on dev environment #169
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@kwangsuk @anand-kumar-subramanian @mbalachandar @amrutasali @sachinholla @sneelam20 Please help in review and merge |
|
We typically use |
| .idea | ||
| test/bookworm/*.deb | ||
| test/bookworm/*.whl | ||
| container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible generate all outputs under build directory?
| # | ||
|
|
||
| ifneq ($(SONIC_YANG_IMPORTS),) | ||
| SONICYANG_IMPORTS = $(shell echo $(SONIC_YANG_IMPORTS)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What values will be passed through SONIC_YANG_IMPORTS variable?? I don't see any usage.. Also, $(shell echo $(SONIC_YANG_IMPORTS)) will be same as $(SONIC_YANG_IMPORTS)
|
|
||
| OUTPUT_DIR=./ | ||
| DETAILED_COV=n | ||
| SKIP_BUILD=n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see DETAILED_COV and SKIP_BUILD used anywhere. Is this an incomplete script?
| pushd build/tests/cvl | ||
| CVL_SCHEMA_PATH=testdata/schema \ | ||
| ./cvl.test -test.v -alsologtostderr -test.coverprofile coverage.cvl || STATUS=1 | ||
| generate_html_report coverage.cvl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these coverage files will be generated under repo root, right? I don't think there is any cleanup step. Better to use some subdirectory under build directory as OUTPUT_DIR
| ./transformer.test -test.v -alsologtostderr -test.coverprofile coverage.transformer || STATUS=5 | ||
| generate_html_report coverage.transformer | ||
| popd | ||
| exit ${STATUS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this script to test or tools/test directory?
Also, the content looks duplicate of steps in azure-pipelines.yml file. Can the pipeline sanity step just invoke this script?
| @@ -0,0 +1,80 @@ | |||
| #!/bin/bash -x | |||
|
|
|||
| # Run sanity tests for sonic-mgmt-common. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to run tests locally on the development server? If yes please explore the tools/test/translib-test.sh script as well. You can execute gotests without compiling a test binary.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This change is to provide a way to run go tests present in sonic-mgmt-common locally in dev environment
~buildimage-compilation/sonic-buildimage/src/sonic-mgmt-common > make -f makefile.test
cp ~/buildimage-compilation/sonic-buildimage/src/sonic-mgmt-common/../../target/debs/bookworm//libyang_1.0.73_amd64.deb test/bookworm
cp ~/buildimage-compilation/sonic-buildima
ge/src/sonic-mgmt-common/../../target/debs/bookworm//libyang-dev_1.0.73_amd64.deb test/bookworm
cp ~/buildimage-compilation/sonic-buildima
ge/src/sonic-mgmt-common/../../target/debs/bookworm//libyang-dbgsym_1.0.73_amd64.deb test/bookworm
cp ~/buildimage-compilation/sonic-buildima
ge/src/sonic-mgmt-common/../../target/debs/bookworm//libyang-cpp_1.0.73_amd64.deb test/bookworm
cp ~/buildimage-compilation/sonic-buildima
ge/src/sonic-mgmt-common/../../target/python-wheels/bookworm//sonic_yang_models-1.0-py3-none-any.whl
test/bookworm
docker build --build-arg no_proxy=.cisco.com,.webex.com,localhost,127.0.0.1,10.0.0.0/8,172.16.0.0/12,
192.168.0.0/16
....
PASS
coverage: 42.5% of statements in ../translib/transformer
~/buildimage-compilation/sonic-buildimage/src/sonic-mgmt-common