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

Test TravisCI #95

Draft
wants to merge 7 commits into
base: upstream
Choose a base branch
from
Draft

Test TravisCI #95

wants to merge 7 commits into from

Conversation

jrha
Copy link
Member

@jrha jrha commented Jun 4, 2018

DO NOT MERGE!

Proof of concept, modifies code all over the place to get tests running.

@jrha jrha force-pushed the travis branch 6 times, most recently from 7f0b1c1 to bbd5b45 Compare June 4, 2018 12:24
@jrha jrha changed the title Add test travis config Test TravisCI Jun 4, 2018
@jrha jrha force-pushed the travis branch 4 times, most recently from a554e71 to 6968a67 Compare June 4, 2018 13:53
@jrha
Copy link
Member Author

jrha commented Jun 4, 2018

Ok it works well enough to prove the point, I'm expecting a student to be working on this from 18th June.

@jrha jrha force-pushed the travis branch 14 times, most recently from 2aaf2e7 to 8e951bc Compare June 4, 2018 16:04
jrha added 2 commits June 27, 2018 11:21
* Copy HOME from standard environment
* Add dependency on protobuf 3.6.0
* Install knc
* Install protocols to /usr/local/lib/...
* Use locally installed knc
* Force service name to be aquilon
* Set keytab location

Change-Id: I3dabb9e17d9ad4686a19336e121b1aceb925cf0d
Let's see how far we get
@jrha
Copy link
Member Author

jrha commented Jun 27, 2018

It turned out to be easier to get kerberos installed and running on Travis than to fake it. We built and tested that as a separate repository https://github.com/jrha/krb5-travis and this makes use of those scripts.

There are a few places where we played around with modifying env to preserve HOME, this was to allow the git configuration to be picked up and avoid the tests dying due to:

Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'travis@travis-job-42beb0f8-567c-4078-a82d-aa8d4b7d9ec1.(none)

Getting the DSDB related tests to run feels like fighting multiple Catch 22s, particularly due to this block of code, I think we've got as we can without input from experts... @urbonegi?

Change-Id: I9c010847d3b14e10d8c2f7946a3164f44011c9d0
@jrha
Copy link
Member Author

jrha commented Jun 28, 2018

Ok, I've added that and tried with DSDB enabled, but all the tests now fail at a lower level because they cannot import ms.dsdb.client, which cannot be easily provided as the name-space conflicts with the "bootstrapped" ms module, another Catch 22 I think.
Any suggestions before I make some bodges to try and work around this?

@urbonegi
Copy link

urbonegi commented Jul 2, 2018

@jrha strange... The import should work cause it will import from the 'fakemodules' in case the unittest run. This is achieved with a help of this config option:
https://github.com/quattor/aquilon/blob/upstream/tests/unittest.conf.noms#L81
and this piece of code:
https://github.com/quattor/aquilon/blob/upstream/lib/twisted/plugins/aqd.py#L138

Maybe old version of the aquilon code does not have the newest unittest conf with fakemodule path. Or the fakemodele itself:
https://github.com/quattor/aquilon/blob/upstream/tests/fakemodules/ms/dsdb/client.py

I will try setup this myself, in case none of the above helps :)

except ImportError:
pass
else:
ms.version.addpkg('setuptools', '0.6c11')

Choose a reason for hiding this comment

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

why this one is added? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know, I copied and pasted it from you?

Choose a reason for hiding this comment

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

i might have copied if from somewhere else. My bad. Actually we might release this fix ourselves next week and push to github. Will let you know then we can rebase this one :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool

@jrha
Copy link
Member Author

jrha commented Jul 25, 2018

This is still not ready for review, I'm working on debugging the python environment still.

.travis.yml Outdated
@@ -6,7 +6,7 @@ before_script:
- curl https://raw.githubusercontent.com/jrha/krb5-travis/master/install_knc | bash
- wget https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip -O /tmp/protoc.zip && cd /tmp && unzip /tmp/protoc.zip && sudo cp bin/protoc /usr/bin/ && sudo chmod ugo+x /usr/bin/protoc
- cd /tmp && git clone https://github.com/quattor/aquilon-protocols.git && cd aquilon-protocols && git checkout upstream && ./setup.py build && sudo ./setup.py install --install-lib /usr/local/lib/aquilon/protocols/lib/python
- cd $TRAVIS_BUILD_DIR/tools/bootstrap_ms && python setup.py install
- cd $TRAVIS_BUILD_DIR/tools/bootstrap_ms && python setup.py install && ls /home/travis/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages/*
Copy link

@urbonegi urbonegi Jul 25, 2018

Choose a reason for hiding this comment

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

Another way to check this would be to try to run the Aquilon dev server outside MS with the updated config to include [unittest] section and fake_module_location = %(srcdir)s/tests/fakemodules/
It is not easy to recreate this in MS cause we have modified python which does mess with sys path and import itself. I do not have Aquilon dev environment outside MS, if the import ms.dsdb.client keeps failing i might create one and help out with this. I have an idea that we might need to add import ms for the outside MS...

Copy link
Member Author

Choose a reason for hiding this comment

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

The kludge I've got now seems to be working, but yes it would be better to find a cleaner way to get it working.

@jrha jrha force-pushed the travis branch 2 times, most recently from 3182b17 to 6585a70 Compare July 25, 2018 14:43
Change-Id: I193a4a302c71195ef4b53c060e3ef782beacfe5f
@jrha
Copy link
Member Author

jrha commented Jul 25, 2018

Phew! At least the tests seem to be failing for more reasonable reasons now.

@urbonegi
Copy link

Awesome! You made me nervous of my python skills :) so the current failures are also about DSDB, however, these are different DSDB integration which is even more interesting. Idea is that we call dsdb_fakebin instead of real one:
https://github.com/quattor/aquilon/blob/upstream/tests/fakebin/fake_dsdb
it records the 'expected command' by adding it to a file; then 'verify command' check that the fail contains it. So question is does the echo "$*" >> "${AQTEST_DSDB_COVERAGE_DIR}/issued_dsdb_cmds" work.

Change-Id: I05db6b3f2ea1743d68753ef4d8b4a743588d77a6
@jrha
Copy link
Member Author

jrha commented Jul 26, 2018

Looks like the answer to that is no!

Change-Id: I7b1e4f2d9c747f4560745a1d1cad65317182a63b
@jrha
Copy link
Member Author

jrha commented Jul 26, 2018

At least the git based checks are working now.

@jrha jrha force-pushed the travis branch 5 times, most recently from c5e9611 to 643da45 Compare July 26, 2018 10:44
Change-Id: I6f7ba5a9da3c1341bfa56788ee48510853ce0b61
@XaF
Copy link

XaF commented Jul 30, 2018

Just a comment to mention I'm happy that we're moving on having tests done directly in here too!

@Shaeli
Copy link

Shaeli commented Aug 23, 2018

Hi @jrha, I’m looking for something to contribute, can I try to continue this, as you proposed in PR 102?

@jrha
Copy link
Member Author

jrha commented Aug 24, 2018

Yes please, feel free to fork my branch.

@jrha jrha marked this pull request as draft December 23, 2021 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants