Skip to content

Commit 8d25fd8

Browse files
committed
add tag to disable buf tests in CI
1 parent 2ec3dce commit 8d25fd8

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

gradle/special-tests.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ apply plugin: 'com.adarshr.test-logger'
33
def special = [
44
'Npm',
55
'Black',
6-
'Clang'
6+
'Clang',
7+
'Buf'
78
]
89

910
boolean isCiServer = System.getenv().containsKey("CI")

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/BufIntegrationTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717

1818
import java.io.IOException;
1919

20+
import com.diffplug.spotless.tag.BufTest;
21+
2022
import org.junit.jupiter.api.Test;
2123

24+
@BufTest
2225
class BufIntegrationTest extends GradleIntegrationHarness {
2326
@Test
2427
void buf() throws IOException {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2022 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.tag;
17+
18+
import org.junit.jupiter.api.Tag;
19+
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.Target;
22+
23+
import static java.lang.annotation.ElementType.METHOD;
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
@Target({TYPE, METHOD})
28+
@Retention(RUNTIME)
29+
@Tag("Buf")
30+
public @interface BufTest {}

testlib/src/test/java/com/diffplug/spotless/protobuf/BufStepTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717

1818
import java.io.File;
1919

20+
import com.diffplug.spotless.tag.BufTest;
21+
2022
import org.junit.jupiter.api.Test;
2123

2224
import com.diffplug.spotless.StepHarnessWithFile;
2325

26+
@BufTest
2427
class BufStepTest {
2528
@Test
2629
void test() throws Exception {

0 commit comments

Comments
 (0)