You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Scenarios/Contribute.md
+3-50Lines changed: 3 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,21 +45,17 @@ In the AL-Go repository we use a number of precommit hooks to help us identify i
45
45
46
46
## Testing your contributions
47
47
48
-
When contributing to AL-Go, it's important to add tests for your changes to ensure code quality and prevent regressions. AL-Go uses both unit tests and end-to-end tests to validate functionality.
48
+
When contributing to AL-Go, it's important to add tests for your changes to ensure code quality and prevent regressions.
49
49
50
50
**When to add tests:**
51
51
52
52
-**Always add unit tests** for new functions, modules, or bug fixes
53
-
-**Add end-to-end scenario tests** for new workflows or features that involve repository setup and GitHub Actions
54
53
-**Update existing tests** if you modify existing functionality
55
54
-**Ensure all tests pass** before submitting a pull request
56
55
57
-
**Types of tests in AL-Go:**
56
+
Unit tests in AL-Go are fast, isolated tests that verify individual functions and modules using the Pester testing framework.
58
57
59
-
1.**Unit Tests** - Fast, isolated tests that verify individual functions and modules using Pester
60
-
2.**End-to-End Tests** - Comprehensive tests that create real GitHub repositories and run complete workflows
61
-
62
-
The sections below provide detailed guidance on how to add each type of test.
58
+
The section below provides detailed guidance on how to add unit tests.
63
59
64
60
## Unit tests
65
61
@@ -133,49 +129,6 @@ In the e2eTests folder, in the AL-Go repository, there are 3 types of end to end
133
129
- SpecialCharacters - testing that various settings (+ publisher name and app name) can contain special national characters
134
130
- and more...
135
131
136
-
### How to add end-to-end scenario tests
137
-
138
-
When adding new features to AL-Go, consider adding an end-to-end scenario test to validate the feature works in a real-world context.
139
-
140
-
**Creating a new scenario test:**
141
-
142
-
1. Create a new folder under `e2eTests/scenarios/` with a descriptive name (e.g., `MyNewFeature`)
143
-
2. Create a `runtest.ps1` file in your scenario folder
144
-
3. The test script should:
145
-
- Accept standard parameters (see existing scenario tests for the parameter template)
146
-
- Create temporary GitHub repositories to test against
147
-
- Configure the repositories with the necessary settings
148
-
- Run workflows and validate the results
149
-
- Clean up repositories on success (leave them for debugging on failure)
150
-
151
-
**Example scenario test structure:**
152
-
153
-
```powershell
154
-
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Justification = 'Global vars used for local test execution only.')]
# Create repository, configure settings, run workflows, validate results
165
-
# See existing scenario tests for examples
166
-
```
167
-
168
-
**Best practices for E2E tests:**
169
-
170
-
- Use descriptive scenario names that explain what functionality is being tested
171
-
- Include comments explaining the test scenario and steps
172
-
- Use unique repository names to avoid conflicts with other tests
173
-
- Clean up resources (repositories) after successful test runs
174
-
- Leave failed test repositories for debugging purposes
175
-
- Test both success and failure scenarios where applicable
176
-
177
-
**Note:** E2E tests require specific GitHub organization setup and credentials. They are automatically run by the AL-Go team during PR review, so you typically don't need to run them locally during development.
178
-
179
132
In your personal fork, you can now run the end to end tests, if the following pre-requisites are available:
180
133
181
134
- You need to have a GitHub organization setup, which will contain all the temporary repositories created by the end to end testing. This organization needs to have at least two instances of a GitHub runner registered as self-hosted (for running all private repo builds)
0 commit comments