-
Notifications
You must be signed in to change notification settings - Fork 76
Fix: Очистка каталогов результатов allure перед формированием результатов #176
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
Open
Kyrales
wants to merge
8
commits into
firstBitMarksistskaya:develop
Choose a base branch
from
Kyrales:fix/clear_allure_before
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
33e7fee
Добавлена очистка каталога Allure при инициализации базы, чтобы не вы…
Kyrales fd627a9
Очистка каталога результатов allure для Yaxunit перед формированием р…
Kyrales 043e6e7
fix: Очистка каталогов результатов перед выполнением syntax-check
Kyrales b953fa6
fix: Очистка каталогов результатов перед выполнением smoke
Kyrales 8e9b77f
Merge branch 'firstBitMarksistskaya:develop' into develop
Kyrales a534ce2
Merge branch 'develop' of https://github.com/Kyrales/jenkins-lib into…
Kyrales 8847634
Merge branch 'develop' into fix/clear_allure_before
Kyrales 902f43d
fix: В createDir() Добавлен необязательный параметр deleteDir (по умо…
Kyrales File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,136 @@ | ||
| # Описание интеграционных тестов | ||
|
|
||
| ## Общая информация | ||
|
|
||
| Все интеграционные тесты используют: | ||
| - **Jenkins Test Harness** для запуска тестового экземпляра Jenkins | ||
| - **RuleBootstrapper** для настройки локальной библиотеки как shared library | ||
| - **JUnit 4** для структуры тестов | ||
| - **Declarative Pipeline** для проверки работы в реальном Jenkins окружении | ||
|
|
||
| --- | ||
|
|
||
| ## 1. `jobConfigurationTest.groovy` | ||
|
|
||
| **Назначение:** Проверка функции `jobConfiguration()` для чтения и слияния конфигураций. | ||
|
|
||
| ### Тесты: | ||
|
|
||
| 1. **`"jobConfiguration should not fail without file"`** | ||
| - Проверяет, что `jobConfiguration()` не падает при отсутствии файла конфигурации | ||
| - Использует значения по умолчанию | ||
| - Ожидается успешное выполнение пайплайна | ||
|
|
||
| 2. **`"jobConfiguration should merge configurations"`** | ||
| - Проверяет слияние конфигураций из файла `jobConfiguration.json` | ||
| - Создает файл конфигурации в workspace и проверяет значения: | ||
| - `v8version='8.3.12.1500'` | ||
| - `sonarScannerToolName='sonar-scanner'` | ||
| - `initMethod=FROM_SOURCE` | ||
| - `dbgsPath=C:\Program files\1cv8\8.3.12.1500\bin\dbgs.exe` | ||
| - `coverage41CPath=C:\coverage\Coverage41C.exe` | ||
|
|
||
| --- | ||
|
|
||
| ## 2. `pipeline1cTest.groovy` | ||
|
|
||
| **Назначение:** Проверка основного пайплайна `pipeline1C()`. | ||
|
|
||
| ### Тесты: | ||
|
|
||
| 1. **`"pipeline1C should do something"`** | ||
| - Проверяет базовое выполнение `pipeline1C()` | ||
| - Создает агента с меткой `"agent"` | ||
| - Проверяет наличие `'(pre-stage)'` в логах | ||
| - Минимальная проверка, что пайплайн запускается | ||
|
|
||
| --- | ||
|
|
||
| ## 3. `cmdTest.groovy` | ||
|
|
||
| **Назначение:** Проверка функции `cmd()` для выполнения команд. | ||
|
|
||
| ### Тесты: | ||
|
|
||
| 1. **`"cmd should echo something"`** | ||
| - Проверяет выполнение команды `echo helloWorld` | ||
| - Проверяет наличие `'helloWorld'` в логах | ||
| - Проверяет базовое выполнение команды | ||
|
|
||
| 2. **`"cmd should return status"`** | ||
| - Проверяет возврат кода возврата команды | ||
| - Выполняет `cmd("false", true)` (второй параметр - возврат статуса) | ||
| - Проверяет, что статус равен `1` (команда `false` возвращает 1) | ||
| - Проверяет корректную обработку кода возврата | ||
|
|
||
| --- | ||
|
|
||
| ## 4. `printLocationTest.groovy` | ||
|
|
||
| **Назначение:** Проверка функции `printLocation()` для логирования информации о ноде. | ||
|
|
||
| ### Тесты: | ||
|
|
||
| 1. **`"Logger should echo current node name"`** | ||
| - Проверяет вывод имени текущего нода | ||
| - Проверяет наличие `'Running on node built-in'` в логах | ||
| - Проверяет корректное определение нода выполнения | ||
|
|
||
| --- | ||
|
|
||
| ## 5. `RuleBootstrapper.groovy` (вспомогательный класс) | ||
|
|
||
| **Назначение:** Утилита для настройки тестового окружения. | ||
|
|
||
| ### Функции: | ||
| - Настраивает `JenkinsRule` для использования локального исходного кода как shared library | ||
| - Создает `LibraryConfiguration` с именем `'testLibrary'` | ||
| - Устанавливает библиотеку как неявно загружаемую (`implicit = true`) | ||
| - Устанавливает таймаут тестов в 30 секунд | ||
| - Используется во всех тестах через аннотацию `@Before` | ||
|
|
||
| --- | ||
|
|
||
| ## Ресурсы | ||
|
|
||
| ### `test/integration/resources/jobConfiguration.json` | ||
|
|
||
| Тестовый файл конфигурации, содержит: | ||
| - Версию платформы 1С: `8.3.12.1500` | ||
| - Настройки инициализации ИБ (`fromSource`) | ||
| - Пример расширения конфигурации | ||
| - Настройки покрытия кода (пути к `dbgs.exe` и `Coverage41C.exe`) | ||
|
|
||
| --- | ||
|
|
||
| ## Итоговая статистика | ||
|
|
||
| - **Всего тестовых классов:** 4 | ||
| - **Всего тестов:** 6 | ||
| - **Вспомогательных классов:** 1 (`RuleBootstrapper`) | ||
| - **Тестовых ресурсов:** 1 (`jobConfiguration.json`) | ||
|
|
||
| ## Покрытие функциональности | ||
|
|
||
| - ✅ Чтение и слияние конфигураций (`jobConfiguration`) | ||
| - ✅ Основной пайплайн (`pipeline1C`) | ||
| - ✅ Выполнение команд (`cmd`) | ||
| - ✅ Логирование информации о ноде (`printLocation`) | ||
|
|
||
| --- | ||
|
|
||
| ## Запуск тестов | ||
|
|
||
| Для запуска всех интеграционных тестов используйте: | ||
|
|
||
| ```bash | ||
| .\gradlew.bat integrationTest | ||
| ``` | ||
|
|
||
| Для запуска конкретного теста: | ||
|
|
||
| ```bash | ||
| .\gradlew.bat integrationTest --tests "jobConfigurationTest" | ||
| ``` | ||
|
|
||
| Тесты проверяют базовую функциональность библиотеки в реальном окружении Jenkins через Jenkins Test Harness. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| def call(String path) { | ||
| def call(String path, boolean deleteDir = false) { | ||
| if (deleteDir && fileExists(path)) { | ||
| deleteDir(path) | ||
| } | ||
| dir(path) { echo '' } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.