buildbot: Do not invoke aspell on non tpk branches. 02/66102/2
authorTomasz Olszak <t.olszak@samsung.com>
Fri, 15 Apr 2016 07:33:29 +0000 (09:33 +0200)
committerTomasz Olszak <t.olszak@samsung.com>
Wed, 20 Apr 2016 09:55:47 +0000 (02:55 -0700)
Change-Id: Ib3d2dff49539206bb2d135c9aafb5b87e49c57cd

tool/development/buildbot/nativesamples.py
tool/development/convert-tpk-to-sample-project.sh

index 7e21729..07f9035 100644 (file)
@@ -720,14 +720,14 @@ class NativeSamples:
                if changeInfo is not None:
                        if changeInfo['status'] != "MERGED" and changeInfo['status'] != "ABANDONED":
                                nativeSampleChange.changeId = changeInfo['id']
-
-                               if self._currentSourceType() == self.SourceTypeTpkProject:
+                               sourceType = self._currentSourceType()
+                               if sourceType == self.SourceTypeTpkProject:
                                        result, message = self.buildSampleFromTpkBranch(nativeSampleChange, changeInfo)
                                        if result:
                                                self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: Compilation successful")
                                        else:
                                                self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: Compilation failed:\n"+message)
-                               elif self._currentSourceType() == self.SourceTypeSampleProject:
+                               elif sourceType == self.SourceTypeSampleProject:
                                        result, message = self.buildSampleFromProjectBranch(nativeSampleChange, changeInfo)
                                        if result:
                                                self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: Project creation and compilation successful")
@@ -746,11 +746,15 @@ class NativeSamples:
                                else:
                                        self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: checkpatch_tizen failed:\n"+message)
 
-                               result, message = self.checkSampleUsingAspell(nativeSampleChange, changeInfo)
-                               if result:
-                                       self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: spelling check successful")
-                               else:
-                                       self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: fix spelling check errors or add words to ignore list:\n"+message)
+                               if sourceType == self.SourceTypeTpkProject:
+                                       result, message = self.checkSampleUsingAspell(nativeSampleChange, changeInfo)
+                                       if result:
+                                               self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: spelling check successful")
+                                       else:
+                                               self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: fix spelling check errors or add words to ignore list:\n"+message)
+                               elif sourceType == self.SourceTypeSampleProject:
+                                       self.gerrit.addCommentToChange(nativeSampleChange, "BuildBot: spelling disabled for non tpk branches\n")
+
 
                        else:
                                print "Change already " + changeInfo['status']
@@ -796,6 +800,8 @@ class NativeSamples:
                        print '=======> CHECKPATCH_TIZEN ', nativeSample.projectName
                        ret["CHECKPATCH_TIZEN"] = convertResult(self.invokeCheckpatchTizen())
 
+                       self._cleanRepoAndCheckoutToRevision(repoPath = nativeSample.projectPath, revision="origin/tpk")
+
                        print '=======> ASPELL_CHECK ', nativeSample.projectName
                        ignoredWordsList = []
                        ret["ASPELL_CHECK"] = convertResult(self.invokeAspell(ignoredWordsList))
@@ -805,8 +811,6 @@ class NativeSamples:
                                ignoredWordsCsvStr += ",".join([dirname, fileName, ignoredWord[1], str(ignoredWord[2]), ignoredWord[3], ignoredWord[1]]) + "\n"
                        ret["ASPELL_CHECK"]["comment"] = ret["ASPELL_CHECK"]["comment"] + "\nINGORED_LIST_CSV:\n" + ignoredWordsCsvStr
 
-                       self._cleanRepoAndCheckoutToRevision(repoPath = nativeSample.projectPath, revision="origin/tpk")
-                       #now we are on tpk branch - let's get first change
                        print '=======> COMMENT_RATIO for ', nativeSample.projectName
                        resultList = list(self.invokeCloc())
                        languagesOutputList = resultList[2]
index 686ee74..dcd0fb2 100755 (executable)
@@ -114,6 +114,7 @@ print_debug_info "Copying sample project files to $PWD"
 mkdir -p $outputDir/project
 
 cp $tmpDir/sample-project-src/* $outputDir
+rm -rf $outputDir/aspell.ignore.json
 
 TPK_SOURCE_DIR=$outputDir/project