Skip to content

Commit

Permalink
chore: avoid leaking the project
Browse files Browse the repository at this point in the history
  • Loading branch information
kmruiz committed May 23, 2024
1 parent 27b73d2 commit 0c6d4c3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/quality-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
sudo apt install -y docker docker-compose
- name: Run Test Suite
run: |
./gradlew --console=plain "clean" "cleanTest" "unitTest"
./gradlew --stacktrace --console=plain "clean" "cleanTest" "unitTest"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
Expand Down
26 changes: 14 additions & 12 deletions gradle/diktat.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
- name: MISSING_KDOC_CLASS_ELEMENTS
- name: MISSING_KDOC_CLASS_ELEMENTS # Allow having class where fields don't have kdoc
enabled: false
- name: MISSING_KDOC_ON_FUNCTION
- name: MISSING_KDOC_ON_FUNCTION # Allow functions to not have kdoc (too noisy comments)
enabled: false
- name: GENERIC_VARIABLE_WRONG_DECLARATION
- name: GENERIC_VARIABLE_WRONG_DECLARATION # Allow generics without boundaries
enabled: false
- name: FILE_WILDCARD_IMPORTS
- name: FILE_WILDCARD_IMPORTS # Allow wildcard imports (like java.util.*)
enabled: false
- name: TOO_LONG_FUNCTION
enabled: false
- name: KDOC_NO_EMPTY_TAGS
- name: TOO_LONG_FUNCTION # Allow long-ish functions, sometimes they are convenient
enabled: true
configuration:
maxFunctionLength: 50
- name: KDOC_NO_EMPTY_TAGS # Allow kdocs without specifying obvious parameters.
enabled: false
- name: WRONG_INDENTATION
- name: WRONG_INDENTATION # Indentation is managed by intellij
enabled: false
- name: MAGIC_NUMBER
- name: MAGIC_NUMBER # Allow magic numbers on array access and ports
enabled: false
- name: TOO_MANY_PARAMETERS
- name: TOO_MANY_PARAMETERS # Allow at least 10 parameters (some signatures can be complex when working with intellij)
enabled: true
configuration:
maxParameterListSize: '10'
- name: FILE_NAME_INCORRECT
- name: FILE_NAME_INCORRECT # File name does not need to match class name inside
enabled: false
- name: LOCAL_VARIABLE_EARLY_DECLARATION
- name: LOCAL_VARIABLE_EARLY_DECLARATION # Allow declaring variables at the beginning of a function if they are mutable
enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.progress.EmptyProgressIndicator
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.util.Disposer
import com.intellij.testFramework.junit5.RunInEdt
import com.intellij.testFramework.junit5.TestApplication
import com.intellij.util.ui.EDT
Expand Down Expand Up @@ -84,6 +85,7 @@ internal class IntegrationTestExtension : BeforeAllCallback,
ProjectUtil.openOrCreateProject(testClassName, Files.createTempDirectory(testClassName))!!
}

Disposer.register(ApplicationManager.getApplication(), project)
context.getStore(namespace).put(projectKey, project)

val dataSource = runBlocking {
Expand Down

0 comments on commit 0c6d4c3

Please sign in to comment.