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

CATROID-449 move end2end tests against share to nightly runs #3451

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pipeline {
catchError(buildResult: 'FAILURE' ,stageResult: 'FAILURE') {
sh '''./gradlew -PenableCoverage -PlogcatFile=instrumented_unit_logcat.txt -Pemulator=android28 \
startEmulator createCatroidDebugAndroidTestCoverageReport \
-Pandroid.testInstrumentationRunnerArguments.package=org.catrobat.catroid.test'''
-Pandroid.testInstrumentationRunnerArguments.class=org.catrobat.catroid.testsuites.LocalHeadlessTestSuite'''
}
}

Expand Down
52 changes: 52 additions & 0 deletions Jenkinsfile.OutgoingNetworkCallsTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!groovy

pipeline {
agent {
dockerfile {
filename 'Dockerfile.jenkins'
// 'docker build' would normally copy the whole build-dir to the container, changing the
// docker build directory avoids that overhead
dir 'docker'
// Pass the uid and the gid of the current user (jenkins-user) to the Dockerfile, so a
// corresponding user can be added. This is needed to provide the jenkins user inside
// the container for the ssh-agent to work.
// Another way would be to simply map the passwd file, but would spoil additional information
// Also hand in the group id of kvm to allow using /dev/kvm.
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg KVM_GROUP_ID=$(getent group kvm | cut -d: -f3)'
args '--device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -m=6.5G'
label 'LimitedEmulator'
}
}

options {
timeout(time: 2, unit: 'HOURS')
timestamps()
}

stages {
stage('End to end tests requiring share authentication') {
steps {
sh '''./gradlew -PenableCoverage -Pemulator=android28 \
startEmulator createCatroidDebugAndroidTestCoverageReport \
-Pandroid.testInstrumentationRunnerArguments.class=org.catrobat.catroid.testsuites.OutgoingNetworkCallsTestSuite'''
}
post {
always {
junit '**/*TEST*.xml'

sh './gradlew stopEmulator clearAvdStore'
archiveArtifacts 'logcat.txt'
}
}
}
}

post {
always {
step([$class: 'LogParserPublisher', failBuildOnError: true, projectRulePath: 'buildScripts/log_parser_rules', unstableOnWarning: true, useProjectRule: true])
}
unsuccessful {
notifyChat(['#s2cc', '#catroweb-deployment'])
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import static org.mockito.Mockito.when;

@RunWith(AndroidJUnit4.class)
public class DroneBricksActionTests {
public class DroneBricksActionTest {

private DroneControlService droneControlService;
private DroneConfig droneConfig;
Expand All @@ -66,7 +66,7 @@ public class DroneBricksActionTests {
private int powerInPercent;
private int durationInSeconds;

public DroneBricksActionTests() {
public DroneBricksActionTest() {
powerInPercent = 20;
durationInSeconds = 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static org.catrobat.catroid.formulaeditor.InternTokenType.FUNCTION_NAME;

@RunWith(Parameterized.class)
public class SelectInternTokenTestFunctionWithOneParameter {
public class SelectInternTokenFunctionWithOneParameterTest {

@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static org.catrobat.catroid.formulaeditor.InternTokenType.FUNCTION_NAME;

@RunWith(Parameterized.class)
public class SelectInternTokenTestFunctionWithTwoParameters {
public class SelectInternTokenFunctionWithTwoParametersTest {

@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
import org.catrobat.catroid.common.Constants;
import org.catrobat.catroid.common.ScratchProgramData;
import org.catrobat.catroid.common.ScratchSearchResult;
import org.catrobat.catroid.testsuites.annotations.Cat;
import org.catrobat.catroid.web.CatrobatWebClient;
import org.catrobat.catroid.web.ServerCalls;
import org.catrobat.catroid.web.WebScratchProgramException;
import org.catrobat.catroid.web.WebconnectionException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.io.InterruptedIOException;
Expand All @@ -51,6 +53,7 @@
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;

@Category(Cat.OutgoingNetworkTests.class)
@RunWith(AndroidJUnit4.class)
public class ScratchServerCallsTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2018 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* An additional term exception under section 7 of the GNU Affero
* General Public License, version 3, is available at
* http://developer.catrobat.org/license_additional_term
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package org.catrobat.catroid.testsuites;

import org.catrobat.catroid.testsuites.annotations.Cat;
import org.junit.experimental.categories.Categories;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Categories.class)
@Categories.ExcludeCategory({Cat.OutgoingNetworkTests.class})

@Suite.SuiteClasses(AllHeadlessTestsSuite.class)
public class LocalHeadlessTestSuite {
}