forked from apache/flink-connector-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up archunit tests and violations
- Loading branch information
Showing
13 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions
4
flink-connector-prometheus-request-signer-amp/archunit-violations/stored.rules
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# | ||
#Mon Oct 28 11:45:11 GMT 2024 | ||
ITCASE\ tests\ should\ use\ a\ MiniCluster\ resource\ or\ extension=6e53c00e-cca1-4df3-a67b-55a742f82f49 | ||
Tests\ inheriting\ from\ AbstractTestBase\ should\ have\ name\ ending\ with\ ITCase=b84f2d4b-67b7-44ff-9dc5-9a946a67c5e9 |
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
39 changes: 39 additions & 0 deletions
39
...or-prometheus-request-signer-amp/src/test/java/architecture/TestCodeArchitectureTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package architecture; | ||
|
||
import org.apache.flink.architecture.TestCodeArchitectureTestBase; | ||
import org.apache.flink.architecture.common.ImportOptions; | ||
|
||
import com.tngtech.archunit.core.importer.ImportOption; | ||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
import com.tngtech.archunit.junit.ArchTest; | ||
import com.tngtech.archunit.junit.ArchTests; | ||
|
||
/** Architecture tests for test code. */ | ||
@AnalyzeClasses( | ||
packages = "org.apache.flink.connector.prometheus", | ||
importOptions = { | ||
ImportOption.OnlyIncludeTests.class, | ||
ImportOptions.ExcludeScalaImportOption.class, | ||
ImportOptions.ExcludeShadedImportOption.class | ||
}) | ||
public class TestCodeArchitectureTest { | ||
@ArchTest | ||
public static final ArchTests COMMON_TESTS = ArchTests.in(TestCodeArchitectureTestBase.class); | ||
} |
30 changes: 30 additions & 0 deletions
30
flink-connector-prometheus-request-signer-amp/src/test/resources/archunit.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# By default we allow removing existing violations, but fail when new violations are added. | ||
freeze.store.default.allowStoreUpdate=true | ||
|
||
# Enable this if a new (frozen) rule has been added in order to create the initial store and record the existing violations. | ||
#freeze.store.default.allowStoreCreation=true | ||
|
||
# Enable this to add allow new violations to be recorded. | ||
# NOTE: Adding new violations should be avoided when possible. If the rule was correct to flag a new | ||
# violation, please try to avoid creating the violation. If the violation was created due to a | ||
# shortcoming of the rule, file a JIRA issue so the rule can be improved. | ||
#freeze.refreeze=true | ||
|
||
freeze.store.default.path=archunit-violations |
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# | ||
#Mon Oct 28 11:44:17 GMT 2024 | ||
ITCASE\ tests\ should\ use\ a\ MiniCluster\ resource\ or\ extension=d962399a-ad51-48ff-ab30-23969cef546c | ||
Tests\ inheriting\ from\ AbstractTestBase\ should\ have\ name\ ending\ with\ ITCase=75250488-2d5e-433d-8fc4-51ff28cb11b3 |
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
39 changes: 39 additions & 0 deletions
39
...-connector-prometheus/src/test/java/org/apache/architecture/TestCodeArchitectureTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.architecture; | ||
|
||
import org.apache.flink.architecture.TestCodeArchitectureTestBase; | ||
import org.apache.flink.architecture.common.ImportOptions; | ||
|
||
import com.tngtech.archunit.core.importer.ImportOption; | ||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
import com.tngtech.archunit.junit.ArchTest; | ||
import com.tngtech.archunit.junit.ArchTests; | ||
|
||
/** Architecture tests for test code. */ | ||
@AnalyzeClasses( | ||
packages = "org.apache.flink.connector.prometheus", | ||
importOptions = { | ||
ImportOption.OnlyIncludeTests.class, | ||
ImportOptions.ExcludeScalaImportOption.class, | ||
ImportOptions.ExcludeShadedImportOption.class | ||
}) | ||
public class TestCodeArchitectureTest { | ||
@ArchTest | ||
public static final ArchTests COMMON_TESTS = ArchTests.in(TestCodeArchitectureTestBase.class); | ||
} |
30 changes: 30 additions & 0 deletions
30
flink-connector-prometheus/src/test/resources/archunit.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# By default we allow removing existing violations, but fail when new violations are added. | ||
freeze.store.default.allowStoreUpdate=true | ||
|
||
# Enable this if a new (frozen) rule has been added in order to create the initial store and record the existing violations. | ||
#freeze.store.default.allowStoreCreation=true | ||
|
||
# Enable this to add allow new violations to be recorded. | ||
# NOTE: Adding new violations should be avoided when possible. If the rule was correct to flag a new | ||
# violation, please try to avoid creating the violation. If the violation was created due to a | ||
# shortcoming of the rule, file a JIRA issue so the rule can be improved. | ||
#freeze.refreeze=true | ||
|
||
freeze.store.default.path=archunit-violations |
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