This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Secret | |
apiVersion: v1 | |
metadata: | |
name: my-github-token | |
namespace: my-namespace | |
annotations: | |
tekton.dev/git-0: 'https://github.com' | |
# stringData is important; if you use data instead, you might get the following error: | |
# Secret in version "v1" cannot be handled as a Secret: illegal base64 data at input byte 6 | |
stringData: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.jupiter.api.Assumptions; | |
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; | |
import org.junit.jupiter.api.extension.ExtensionContext; | |
import org.junit.jupiter.api.extension.TestExecutionExceptionHandler; | |
class AbortRemainingTestsExtension implements TestExecutionExceptionHandler, BeforeTestExecutionCallback { | |
private static final String STORE_KEY = "abort"; | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
triggers { | |
cron('00 23 * * 1-5') | |
} | |
stages { | |
stage('Check dependency updates') { | |
steps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The user agent to use (see https://en.wikipedia.org/wiki/User_agent). | |
USER_AGENT='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Firefox/68.0' | |
# The web pages to download. | |
WEB_PAGES=( | |
'google.com' | |
'youtube.com' | |
'facebook.com' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An abstract base class for all visual tests, defining the pages to test. One can also use separate test cases/methods | |
* if specific pages need different test steps. | |
*/ | |
abstract class AbstractVisualTest { | |
WebDriver driver; | |
Recheck re; | |
abstract WebDriver getWebDriver(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from https://stackoverflow.com/a/47088726/3429133. | |
function getAbsoluteXPath(element) { | |
var comp, comps = []; | |
var parent = null; | |
var xpath = ''; | |
var getPos = function(element) { | |
var position = 1, | |
curNode; | |
if (element.nodeType == Node.ATTRIBUTE_NODE) { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import org.junit.jupiter.api.extension.ExtendWith; | |
@Retention( RetentionPolicy.RUNTIME ) | |
@Target( ElementType.METHOD ) | |
@ExtendWith( SystemPropertyExtension.class ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.{ Function => JFunction } | |
import scala.collection.JavaConverters | |
import com.github.beatngu13.gist.knapsack.KnapsackProblem.Capacity | |
import com.github.beatngu13.gist.knapsack.KnapsackProblem.Items | |
import com.github.beatngu13.gist.knapsack.KnapsackProblem.OptimalProfit | |
import com.github.beatngu13.gist.knapsack.KnapsackProblem.OptimalSolution | |
import io.jenetics.BitChromosome | |
import io.jenetics.BitGene |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.jupiter.params.ParameterizedTest; | |
import org.junit.jupiter.params.provider.MethodSource; | |
import org.openqa.selenium.WebDriver; | |
class CrossBrowserTest { | |
@ParameterizedTest | |
@MethodSource( "my.package.WebDriverFactory#getAll" ) | |
void cross_browser_test( final WebDriver driver ) { | |
System.out.println( "Test with " + driver.getClass().getSimpleName() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://jenkins.io/blog/2016/07/18/pipeline-notifications/. | |
def notifyMessengers(String buildStatus = 'STARTED') { | |
// Build status of null means successful. | |
buildStatus = buildStatus ?: 'SUCCESS' | |
// Replace encoded slashes. | |
def decodedJobName = env.JOB_NAME.replaceAll("%2F", "/") | |
def colorSlack | |
def colorHipchat |
NewerOlder