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

Issues: Install test does not test validity of packages (rpm/deb) #556

Merged

Conversation

ssorenso
Copy link

Fixes #494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do. Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test. To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.

@<reviewer_id>

What issues does this address?

Fixes #
WIP #
...

What's this change do?

Where should the reviewer start?

Any background context?

Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
@@ -18,6 +18,8 @@ before_install:

install:
- pip install tox
- pip install ordereddict
Copy link
Contributor

Choose a reason for hiding this comment

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

The ordereddict and six packages are not required for the build.

Copy link
Author

Choose a reason for hiding this comment

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

Correct. I had forgotten that I had put this in travis. I'll remove them and recommit

from collections import deque, namedtuple

f5_sdk_rest_pattern = re.compile("^f5-sdk\s*=\s*(\d+\.\d+\.\d+)$")
f5_sdk_rest_pattern = re.compile(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this redefined? I am not sure that the f5-sdk-rest pattern will match what you want it to.

Copy link
Author

Choose a reason for hiding this comment

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

The pattern is not used anymore. Will remove.

match = dep_match_re.match(line)
if match:
groups = list(match.groups())
my_dep = ReqDetails(groups[0], groups[2], groups[3])
Copy link
Contributor

Choose a reason for hiding this comment

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

Is groups[0] the whole line? Or is this the package name?

Copy link
Author

Choose a reason for hiding this comment

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

I stumbled upon this too. Python2.7's re (at least) is behaving a little differently than I would expect here, and I had to work through it in the debugger. This was what I found:

Normally, groups[0] would be the whole match; however, in this case because I'm doing a match within a match, I get:

dep_match_re = re.compile('^((python|f5-sdk)[\w-]*)\s([<>=]{1,2})\s(\S+)')
dependent = 'python-six >= 1.10.2'
match = dep_match_re.search(dependent)
match
<_sre.SRE_Match object at 0x100e6cca8>
match.groups()
('python-six', 'python', '>=', '1.10.2')

0: 'python-six' is given by the ^((python|f5-sdk)[\w-]+)
1: 'python' is given by the internal expression (python|f5-sdk)
2: '>=' is given by the ([<>=]{1,2})
3: (\S+)

Python acts a little differently when you're doing match within a match... it's a little hairy and unfortunate that it behaves this way. I would, like what you're implying, expect it to be 0 - the full match 1 - the python-six 2 - the python|f5-sdk matching. It normally behaves this way, so for it to be different for a match-within-a-match was confusing.

RUN apt-get install python-requests git curl -y --force-yes
RUN apt-get install python-six

COPY ./fetch_and_install_deps.py /

Copy link
Contributor

Choose a reason for hiding this comment

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

While you are at it you might as well change the way this is invoked so that invocation fails by using CMD or ENTRYPOINT.

Copy link
Author

Choose a reason for hiding this comment

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

Can do. Will grep for where else 'ENTRYPOINT' and 'CMD' is being used in-code and try and script-kitty. Hopefully, I'll have it working by the time you get in this afternoon.

@@ -4,7 +4,10 @@ FROM ubuntu:trusty
RUN apt-get update -y && apt-get install software-properties-common -y
RUN apt-add-repository cloud-archive:liberty
Copy link
Contributor

Choose a reason for hiding this comment

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

This should work. Would you remove the cloud-archive:mitaka and run this test with cloud-archive:liberty

Copy link
Author

Choose a reason for hiding this comment

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

Err... right. Will remove the additional apt-add-repository...

Copy link
Author

Choose a reason for hiding this comment

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

Confirmed to work with just liberty repo.

Copy link
Contributor

@richbrowne richbrowne left a comment

Choose a reason for hiding this comment

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

See inline comments. We can discuss this. I like what you have done to manage the dependencies.

Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
@ssorenso
Copy link
Author

Forgot the travis change... please ignore this latest push...

…so/f5-openstack-agent into feature_packaging_testing_fix_494
Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
@ssorenso
Copy link
Author

Okay... I think this is ready for review again... Changes made:

  • Made the redhat Docker reflect the ubuntu
  • Made the ubuntu Docker use the ENTRYPOINT setup
  • Fixed the yml to no longer reflect the pip installs that are not necessary
  • Removed the redundant deps pattern declaration/creation

Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
@richbrowne richbrowne self-assigned this Jan 25, 2017
Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
@ssorenso
Copy link
Author

Failed in Travis...
Traceback (most recent call last):
File "/fetch_and_install_deps.py", line 198, in
main(sys.argv)
File "/fetch_and_install_deps.py", line 191, in main
fetch_agent_dependencies(dist_dir, version, release, pkg_fullname)
File "/fetch_and_install_deps.py", line 100, in fetch_agent_dependencies
my_dep = ReqDetails(*m.groups())
TypeError: new() takes exactly 4 arguments (5 given) -- /var/wdir/f5-openstack-agent-dist/scripts/get-version-release.py --version --release

Will have a fix shortly.

Fixes F5Networks#494

Problem:
The test install algorithm to work with a more generic pool

Analysis:
I made the changes to make it so that the .deb and .rpm install tests
would do what they're supposed to do.  Before this change, the .deb and
.rpm failures were not being properly tracked and would always fail due
to improper regExp handling of expected strings.

Tests:
This is a test.  To validate that this executes properly, use the
.travis_yml file in its normal execution phasing.
@richbrowne richbrowne merged commit 826529d into F5Networks:liberty Jan 25, 2017
@ssorenso ssorenso deleted the feature_packaging_testing_fix_494 branch October 6, 2017 20:28
zhang-shengping pushed a commit to zhang-shengping/f5-openstack-agent that referenced this pull request Feb 27, 2019
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.

3 participants