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

chore: Fix scripts for Bazel integration tests #13978

Merged
merged 4 commits into from
Sep 23, 2022

Conversation

vktng
Copy link
Contributor

@vktng vktng commented Sep 21, 2022

Summary

Some integration tests are not properly working with Bazel because of not reachable scripts. these are

  • test_enable_ipv6_iface
  • test_ipv6_paging_with_dedicated_bearer
  • test_ipv4v6_paging_with_dedicated_bearer
    This PR fixes these issues.

Test Plan

CI.

Additional Information

  • This change is backwards-breaking

@vktng vktng added component: ci All updates on CI (Jenkins/CircleCi/Github Action) bazel changes for the Bazelification effort labels Sep 21, 2022
@vktng vktng self-assigned this Sep 21, 2022
@vktng vktng requested review from a team September 21, 2022 09:50
@vktng vktng requested a review from a team as a code owner September 21, 2022 09:50
@pull-request-size pull-request-size bot added the size/L Denotes a Pull Request that changes 100-499 lines. label Sep 21, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added component: agw Access gateway-related issue and removed component: ci All updates on CI (Jenkins/CircleCi/Github Action) labels Sep 21, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2022

Oops! Looks like you failed the Python Format Check.

Howto

♻️ Updated: ✅ The check is passing the Python Format Check after the last commit.

@@ -58,29 +58,30 @@ DENY_LIST_NOT_YET_BAZELIFIED=(
"./lte/gateway/python/integ_tests/cloud_tests"
"./lte/gateway/python/integ_tests/federated_tests"
"./lte/gateway/python/integ_tests/s1aptests/workflow"
"./lte/gateway/python/integ_tests/s1aptests/test_enable_ipv6_iface.py"
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: This just changes the order of the files, no files added or removed.

@mpfirrmann
Copy link
Contributor

Was this just a Bazel issue or did it affect the tests on the make-build AGW as well?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2022

feg-workflow

    2 files  203 suites   39s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit f1ec46b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2022

dp-workflow

14 tests   14 ✔️  3m 5s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit f1ec46b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2022

agw-workflow

615 tests   611 ✔️  5m 1s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit f1ec46b.

♻️ This comment has been updated with latest results.

@@ -60,7 +60,8 @@
from orc8r.protos.directoryd_pb2_grpc import GatewayDirectoryServiceStub

DEFAULT_GRPC_TIMEOUT = 10

MAGTIVATE_CMD = "source /home/vagrant/build/python/bin/activate"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a refactoring as these values were used in various places.

@@ -21,74 +21,34 @@

Copy link
Contributor

@nstng nstng Sep 21, 2022

Choose a reason for hiding this comment

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

Reasons for the refactorings:

  • the script was using sys.exit for communication that values were already changed - especially the return code 1 did basically "override" the return code 1 if the script was not found
    • in general sys.exit > 0 should only be used for errors
  • it does not seem relevant for the usage if the config values already had the desired values
    • -> do not check the current values and always override

Copy link
Contributor

@nstng nstng left a comment

Choose a reason for hiding this comment

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

lgtm % py formatting fixes

respective tests (in make based workflow) did run successfully with this change - see https://github.com/nstng/magma/actions/runs/3091802252

@nstng
Copy link
Contributor

nstng commented Sep 21, 2022

Was this just a Bazel issue or did it affect the tests on the make-build AGW as well?

@mpfirrmann it was just an issue with bazel - the solution for icmpv6.py (affects test_ipv6_paging_with_dedicated_bearer.py and test_ipv4v6_paging_with_dedicated_bearer.py) did still work for the make workflow on fork runs.

Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
…ap_utils.py)

Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
Copy link
Contributor

@sebathomas sebathomas left a comment

Choose a reason for hiding this comment

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

Looking good to me, just a few questions.

else:
print("Failed to configure")
raise Exception("Failed to configure the IPV6 interface!")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is to make the test fail early?

Copy link
Contributor

Choose a reason for hiding this comment

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

to make it fail at all - the test was not failing if the script was not executed successfully

Copy link
Contributor

Choose a reason for hiding this comment

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

See also #13982 why it would be good for this step to fail if the script has problems - it was only visible by info logging that the script was not executed.

execute_icmpv6_cmd = (
"sudo /home/vagrant/build/python/bin/python3 "
+ "/home/vagrant/magma/lte/gateway/python/scripts/icmpv6.py "
MAGTIVATE_CMD
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this didn't activate the venv before, but I assume that's no problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was not done before and in the test runs it was not necessary. Assumption is that it is not needed for this script.

imports = [ORC8R_ROOT],
legacy_create_init = False,
deps = ["//orc8r/gateway/python/magma/configuration:service_configs"],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the main part of the fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, now the script is build with bazel and can be used by the integration tests.

Copy link
Member

@VinashakAnkitAman VinashakAnkitAman left a comment

Choose a reason for hiding this comment

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

LGTM

@nstng nstng merged commit f951954 into magma:master Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel changes for the Bazelification effort component: agw Access gateway-related issue size/L Denotes a Pull Request that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants