Skip to content

Commit 87fa8eb

Browse files
Copilotaholstrup1
andcommitted
Remove E2E testing documentation, keep only unit tests
Co-authored-by: aholstrup1 <117829001+aholstrup1@users.noreply.github.com>
1 parent c1e1ae8 commit 87fa8eb

File tree

1 file changed

+3
-50
lines changed

1 file changed

+3
-50
lines changed

Scenarios/Contribute.md

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,17 @@ In the AL-Go repository we use a number of precommit hooks to help us identify i
4545

4646
## Testing your contributions
4747

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.
4949

5050
**When to add tests:**
5151

5252
- **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
5453
- **Update existing tests** if you modify existing functionality
5554
- **Ensure all tests pass** before submitting a pull request
5655

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.
5857

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.
6359

6460
## Unit tests
6561

@@ -133,49 +129,6 @@ In the e2eTests folder, in the AL-Go repository, there are 3 types of end to end
133129
- SpecialCharacters - testing that various settings (+ publisher name and app name) can contain special national characters
134130
- and more...
135131

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.')]
155-
Param(
156-
[switch] $github,
157-
[string] $githubOwner = $global:E2EgithubOwner,
158-
[string] $repoName = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()),
159-
# ... other standard parameters
160-
)
161-
162-
Write-Host "Testing MyNewFeature scenario"
163-
164-
# 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-
179132
In your personal fork, you can now run the end to end tests, if the following pre-requisites are available:
180133

181134
- 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

Comments
 (0)