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

Smoke tests in diktat #1534

Merged
merged 43 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5479d9b
Smoke tests in diktat
nulls Oct 26, 2022
f220666
split TestUtils.kt
nulls Oct 26, 2022
ce9a66e
refactored smoke tests
nulls Oct 26, 2022
24a376c
fixed test with kts
nulls Oct 26, 2022
8565768
diktatFix
nulls Oct 26, 2022
3ae8383
removed shade plugin
nulls Oct 27, 2022
9c73968
fixed default value for rulesConfig
nulls Oct 27, 2022
a5a048e
fixed default value for rulesConfig
nulls Oct 27, 2022
55d6f7d
unlink smoke tests
nulls Oct 27, 2022
d3319c5
removed test jar for diktat-rules
nulls Oct 27, 2022
c7c0e2d
reverted changes in FixTestBase
nulls Oct 27, 2022
a26f39a
refactored FixTestBase
nulls Oct 27, 2022
0cb6c92
diktatFix
nulls Oct 27, 2022
d994cf1
diktatFix #2
nulls Oct 27, 2022
a613a43
Merge branch 'master' into feature/move-intergration-test#1518
nulls Oct 27, 2022
1e73aa0
added logging in save-cli for windows too
nulls Oct 27, 2022
6e8e64a
Bugfix for fix mode of `AVOID_NULL_CHECK` (#1535)
sanyavertolet Oct 27, 2022
b89368b
Merge remote-tracking branch 'origin/master' into feature/move-interg…
nulls Oct 27, 2022
5257287
WIP
nulls Oct 27, 2022
0b96349
removed debug logging
nulls Oct 28, 2022
49b7d84
moved test run in maven
nulls Oct 28, 2022
0be5071
added **/DiktatSaveSmokeTest.* as include to failsafe
nulls Oct 28, 2022
6d24041
Merge branch 'master' into feature/move-intergration-test#1518
nulls Oct 28, 2022
61da8b2
fixed file name for save-cli tests
nulls Oct 28, 2022
3c3c706
timeout for save-cli smoke tests
nulls Oct 28, 2022
3883dbe
added tree reporter for failsafe too
nulls Oct 28, 2022
82df88b
set big timeout for save-cli process
nulls Oct 28, 2022
845b327
reverted to waitFor for further investigation
nulls Oct 28, 2022
92b7330
set maven.compiler.release only for JDK 11 and more
nulls Oct 28, 2022
1045c24
Merge remote-tracking branch 'origin/master' into feature/move-interg…
nulls Oct 28, 2022
cab2eed
fixed after merge resolving
nulls Oct 28, 2022
e4fa18b
diktatFix + review note
nulls Oct 28, 2022
29d8f51
upgraded save-cli version to 0.3.4
nulls Oct 28, 2022
caee1ac
removed unused methods
nulls Oct 28, 2022
044ada4
removed unused methods #2
nulls Oct 28, 2022
7f36ea1
diktatFix
nulls Oct 28, 2022
e1af678
diktatFix #2
nulls Oct 28, 2022
058e8b9
java exception
nulls Oct 28, 2022
15486d1
diktatFix
nulls Oct 28, 2022
ac8932f
diktatFix #2
nulls Oct 28, 2022
6748f91
diktatFix #3
nulls Oct 28, 2022
fe3696b
diktatFix #4
nulls Oct 28, 2022
a257547
set big timeout for save-cli process
nulls Oct 28, 2022
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
14 changes: 14 additions & 0 deletions diktat-rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,20 @@
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.cqfn.diktat.common.config.rules.RuleConfiguration
/**
* [RuleConfiguration] for indentation logic
*/
internal class IndentationConfig(config: Map<String, String>) : RuleConfiguration(config) {
class IndentationConfig(config: Map<String, String>) : RuleConfiguration(config) {
/**
* Is newline at the end of a file needed
*/
Expand Down Expand Up @@ -87,20 +87,20 @@ internal class IndentationConfig(config: Map<String, String>) : RuleConfiguratio
override fun toString(): String =
"${javaClass.simpleName}$configWithExplicitDefaults"

internal companion object {
companion object {
internal const val ALIGNED_PARAMETERS = "alignedParameters"

/**
* The default indent size (space characters), configurable via
* `indentationSize`.
*/
private const val DEFAULT_INDENTATION_SIZE = 4
internal const val EXTENDED_INDENT_AFTER_OPERATORS = "extendedIndentAfterOperators"
internal const val EXTENDED_INDENT_BEFORE_DOT = "extendedIndentBeforeDot"
internal const val EXTENDED_INDENT_FOR_EXPRESSION_BODIES = "extendedIndentForExpressionBodies"
internal const val EXTENDED_INDENT_OF_PARAMETERS = "extendedIndentOfParameters"
internal const val INDENTATION_SIZE = "indentationSize"
internal const val NEWLINE_AT_END = "newlineAtEnd"
const val EXTENDED_INDENT_AFTER_OPERATORS = "extendedIndentAfterOperators"
const val EXTENDED_INDENT_BEFORE_DOT = "extendedIndentBeforeDot"
const val EXTENDED_INDENT_FOR_EXPRESSION_BODIES = "extendedIndentForExpressionBodies"
const val EXTENDED_INDENT_OF_PARAMETERS = "extendedIndentOfParameters"
const val INDENTATION_SIZE = "indentationSize"
const val NEWLINE_AT_END = "newlineAtEnd"

@Suppress("CUSTOM_GETTERS_SETTERS")
private val IndentationConfig.configWithExplicitDefaults: Map<String, String>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ open class FixTestBase(
* @param expectedPath path to file with expected result, relative to [resourceFilePath]
* @param testPath path to file with code that will be transformed by formatter, relative to [resourceFilePath]
* @param overrideRulesConfigList optional override to [rulesConfigList]
* @param trimLastEmptyLine whether the last (empty) line should be
* discarded when reading the content of [testFileStr].
* @see fixAndCompareContent
*/
protected fun fixAndCompare(
expectedPath: String,
testPath: String,
overrideRulesConfigList: List<RulesConfig> = emptyList()
overrideRulesConfigList: List<RulesConfig> = emptyList(),
trimLastEmptyLine: Boolean = false,
) {
val testComparatorUnit = if (overrideRulesConfigList.isNotEmpty()) {
TestComparatorUnit(resourceFilePath) { text, fileName ->
Expand All @@ -61,7 +64,7 @@ open class FixTestBase(

Assertions.assertTrue(
testComparatorUnit
.compareFilesFromResources(expectedPath, testPath)
.compareFilesFromResources(expectedPath, testPath, trimLastEmptyLine)
)
}

Expand Down
Loading