-
Notifications
You must be signed in to change notification settings - Fork 3
OVS unit tests. JJB yaml file. #1
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
base: master
Are you sure you want to change the base?
Conversation
|
General notes:
|
scripts/unit-tests/linux/ovs-git.sh
Outdated
| head -1 $WORKSPACE/gitlog.txt | tee $WORKSPACE/lastrancommit.txt | ||
| } | ||
|
|
||
| function Start-CommitJob { |
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 guess that this function does is starting a job for checking a commit, so the naming should reflect that, it's not "starting a commit job" - it won't commit anything.
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.
Renamed the functions to reflect what they actually do
scripts/unit-tests/linux/ovs-git.sh
Outdated
| done < $WORKSPACE/gitlog.txt | ||
| } | ||
|
|
||
| export WORKSPACE="/var/lib/jenkins/jobs/master-job/workspace" |
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 never hardcode a workspace that's inside the jenkins-managed workspaces. If you need a common workspace to be shared by multiple jobs, you use a dedicated folder created for that.
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 was a path that was used when testing and forgot to remove it prior to PR
scripts/unit-tests/linux/ovs-git.sh
Outdated
| } | ||
|
|
||
| function Get-GitLog { | ||
| currentcommit=`cat $WORKSPACE/lastrancommit.txt` |
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.
please use powershell cmd-lets, not aliases that are "linux-like"
scripts/unit-tests/linux/ovs-git.sh
Outdated
| while read line | ||
| do | ||
| echo "Starting job for commitID $line" | ||
| curl -X POST "http://$jenk_user:$jenk_api@10.20.1.3:8080/job/ovs-build-job/buildWithParameters?token=b204eee759ab38ebb986d223f6c5b4ce&commitid=$line" |
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.
please use powershell cmd-lets, not aliases that are "linux-like"
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 a linux script and is run on jenkins slave
scripts/unit-tests/linux/ovs-git.sh
Outdated
| if [ ! -e $lastranfile ]; then | ||
| echo "LastRanFile doesn't exist. Creating it." | ||
| cd $WORKSPACE/ovs | ||
| git rev-parse HEAD | tee $WORKSPACE/lastrancommit.txt |
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.
shouldn't you run a test on that "first commit"?
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.
Done. Now it will run the "first commit" test
|
|
||
| if ( $Status -eq "ERROR" ) { | ||
| write-host "Sending make error E-mail for $commitID" | ||
| Send-PassEmail $from "mgheorghe@cloudbasesolutions.com" $smtpServer $commitLink $logLink |
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.
Shouldn't "$to" be listed here as well?
| @@ -0,0 +1,110 @@ | |||
| $ErrorActionPreference = "Stop" | |||
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 script required / executed for each run?
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.
nope, removed
jjb/ovs-unit.yaml
Outdated
| - shell: | | ||
| #!/bin/bash | ||
| set -e | ||
| function Check-LastRanFile { |
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.
why are these functions defined both here and in scripts/unit-tests/linux/ovs-git.sh?
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 will not be present in the jjb
|
|
||
| $Status = $env:status | ||
| $commitID = $env:commitid | ||
| $basePath = "C:\OpenStack\OpenvSwitch" |
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.
Again, use config.ps1, no static variables defined in main file.
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.
done
| @@ -0,0 +1,87 @@ | |||
| function Send-PassEmail ($from, $to, $smtpServer, $commitLink, $logLink) { | |||
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.
Why not a function that takes as parameter also the PASS/FAIL/ERROR status? What's the significant difference between them?
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.
Combined them into one functions "Send-Email"
…d jjb file since it will be hosted in another repo
No description provided.