-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Updating test-go.sh and test-integration.sh to be able to run the tests for multiple API versions #5687
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/. If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits. Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name. |
kube::log::status "Combined coverage report: ${coverage_html_file}" | ||
|
||
if [[ -x "${KUBE_GOVERALLS_BIN}" ]]; then | ||
${KUBE_GOVERALLS_BIN} -coverprofile="${combined_cover_profile}" || true |
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.
This is where a coverage report is sent to Coveralls - so if you call runTests()
multiple times, it's going to report coverage there multiple times.
We probably only want to be reporting coverage once.
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.
Updated the code so that coverage is reported to Coveralls only once.
I'm also a little worried about defaulting to running the unit tests twice - this will make |
2abd4f5
to
c625436
Compare
Updated the code as per comments. |
c625436
to
34d934a
Compare
Have updated the code so that test-go.sh and test-integration.sh now use KUBE_TEST_API_VERSIONS env variable to figure out the API Versions which should be tested. Hence, when run locally, both versions are tested. And when run on travis, v1beta1 is tested with go version 1.3 and v1beta3 is tested with go version 1.4 |
cc @bgrant0607 If it looks good, it can be merged right after #5887 |
- go: 1.4 | ||
env: KUBE_TEST_API_VERSIONS="v1beta1" | ||
- go: 1.3 | ||
env: KUBE_TEST_API_VERSIONS="v1beta3" |
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.
For reference, here is the relevant documentation: http://docs.travis-ci.com/user/build-configuration/#Explicit-inclusion-of-jobs-into-the-build-matrix
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.
was there any particular pattern to using v1beta3 with go1.3 and v1beta1 with go1.4? or were they just semi-randomly chosen?
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.
No particular pattern.
Chosen randomly.
IANA-Bash-Wizard - the travis changes look ok to me. If we're confident in the bash? |
runTests "${@:2}" | ||
} | ||
|
||
reportCoverageToCoveralls() { |
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'm not sure if factoring this out into its own subroutine was really necessary.
I have tested the scripts locally and on travis and they work fine. |
# Convert the CSV to an array of API versions to test | ||
IFS=',' read -a apiVersions <<< ${KUBE_TEST_API_VERSIONS} | ||
for apiVersion in "${apiVersions[@]}"; do | ||
runTests $apiVersion "${@}" |
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.
you didn't previously pass "${@}" to runTests - was this an intentional addition? (It seems like it doesn't really have much effect in any case)
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.
Yes. Was not required.
Removed.
34d934a
to
5e4ab8e
Compare
Replied to comments and have updated the code accordingly. |
LGTM, but are the Shippable and Travis failures related to this PR? |
TestSyncPodsDeletesWithNoPodInfraContainer seems flaky. I have started the tests again to confirm. Will look in more detail if it still fails. |
That test is flaky. I believe there is an issue open. ----- Original Message -----
|
Yes. It passed this time. |
Updating test-go.sh and test-integration.sh to be able to run the tests for multiple API versions
My failures are happening in a dev env without that env set.
|
This line of output is very suspicious: It suggests that somehow this for loop isn't doing the right thing:
Is the version of bash on OS X wacky or something? Which version of OS X are you using, @smarterclayton? |
As another data point, @smarterclayton what happens when you run |
Yosimite
|
@smarterclayton can you run |
I'm pretty sure this broke the build? |
This hit shippable as well. E.g. https://app.shippable.com/builds/551345dd9461c40b00437a04 |
There is a new shippable.yaml submitted just now #5753 which might be causing this. |
Actually that PR was also merged an hour ago. Taking a look. |
The Also, it passed: https://app.shippable.com/builds/55133fed9461c40b004379a8 |
That run (https://app.shippable.com/builds/55133fed9461c40b004379a8) seems like an old one since the tests were run only for "v1beta1" and not for both. |
@nikhiljindal that's what the configuration specifies - go1.4 runs only v1beta1; the other build, which ran go1.3, runs only v1beta3, just like the Travis builds. |
The failing runs (as well as @smarterclayton's local run) all appear to not be specifying KUBE_TEST_API_VERSIONS in the environment, so it uses the default value testing both API versions. For whatever reason this is messing up and the script tries to run both API versions at once, rather than splitting them up as it's supposed to. |
@filbranden as an expert shell expert who has reviewed changes here before, do you have any ideas as to why this might be failing in some environments? |
I rebased and re-pushed, and now it works. So presumably it was the change to shippable.yml that fixed it. |
ok. I can revert this PR if its causing too much pain. |
I would say-- don't revert unless rebasing doesn't fix this for people. |
Setting KUBE_TEST_API_VERSIONS=v1beta1 works fine for me, just not leaving it unset. |
Can we only do this from things like build/release.sh and travis and not And dont get me started about all the slow hooks - a rebase can take 5 On Wed, Mar 25, 2015 at 5:41 PM, Clayton Coleman notifications@github.com
|
FYI, for people having trouble on their local machines, #5974 should help. |
@ixdy There's just so much wrong with this PR... Don't use IFS. Ever. Use arrays for multiple values. It's setting
And missing double quotes in about all variable accesses even though most (or all?) are supposed to expand to a single token (the ones that don't should be using arrays anyways.) Unfortunately the state of bash in Kubernetes got to the point where putting out fires is getting harder and harder... Probably the time to start rethinking this and replacing it with Go or if not Go then Python. Shell is just not maintainable. This is what people smarter than me from a quite successful software company had to say about it: |
Some improvements to #5687
We are not yet ready to run it twice (lots of tests break for v1beta3).
This PR just sets us up so that we can do that whenever we are ready.
I want to make sure that I am not breaking coveralls by this change.
When I run this locally (calling runTestsForVersion twice), it just produces 2 html files, which I think is fine.
@ixdy: Can you confirm?