- 
                Notifications
    You must be signed in to change notification settings 
- Fork 84
Add test targets for running specific, e2e, subset, and CI tests #2067
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
      
      
            rafaelvzago
  wants to merge
  4
  commits into
  skupperproject:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
rafaelvzago:2063
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
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
          
          
            4 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      94feddd
              
                Add test targets for running specific, e2e, subset, and CI tests
              
              
                rafaelvzago 4cf3955
              
                Refactor test commands in Makefile for flexibility and update README …
              
              
                rafaelvzago efb35d0
              
                Update E2E test command in CircleCI to use 'make test-e2e ci-tests' f…
              
              
                rafaelvzago 1373f40
              
                Update E2E test command in CircleCI to change directory before runnin…
              
              
                rafaelvzago 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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -24,6 +24,7 @@ tests/ | |
| │ ├── hello-world/ # Basic Skupper functionality test | ||
| │ ├── attached-connector/ # Network performance test with attached connectors | ||
| │ ├── redis/ # Redis test | ||
| │ ├── ha/ # High availability test | ||
| └── README.md # This file | ||
| ``` | ||
|  | ||
|  | @@ -36,6 +37,7 @@ The `e2e` directory contains tests that validate Skupper functionality across di | |
| - **[hello-world](e2e/hello-world/)**: A simple test to verify basic Skupper functionality by deploying frontend and backend components across Skupper sites. | ||
| - **[attached-connector](e2e/attached-connector/)**: A test to validate Skupper connectivity using attached connectors, including network performance testing with iperf3. | ||
| - **[redis](e2e/redis/)**: A test to validate Skupper functionality with Redis, including data persistence and replication. | ||
| - **[ha](e2e/ha/)**: A test to validate Skupper high availability features, including automatic failover and recovery. | ||
|  | ||
| ## Adding a new E2E test to be run on CI | ||
|  | ||
|  | @@ -94,6 +96,8 @@ make test TEST="hello-world" | |
|  | ||
| 2. **Available Make Commands**: | ||
|  | ||
| This works for the command being used INSIDE the `/tests` directory. The Makefile will automatically create a virtual environment and install all required dependencies. | ||
|  | ||
| ```bash | ||
| # Create or refresh the virtual environment | ||
| make create-venv FORCE=true | ||
|  | @@ -116,6 +120,8 @@ make ci-tests | |
|  | ||
| ### Example summary | ||
|  | ||
| This works for the command being used INSIDE the `/tests` directory. The Makefile will automatically create a virtual environment and install all required dependencies. | ||
|  | ||
| ```bash | ||
| # Create a new virtual environment | ||
| make create-venv FORCE=true | ||
|  | @@ -133,6 +139,36 @@ make test-subset TESTS=hello-world,attached-connector | |
| make ci-tests | ||
| ``` | ||
|  | ||
| ## Running Tests from the ROOT of the Repository | ||
|  | ||
| The root of the repository contains a main Makefile that abstracts and simplifies the process of running tests. This Makefile acts as a wrapper, delegating specific commands to the Makefile located in the `tests` directory. By using the main Makefile, you can execute test-related commands from the root of the repository without needing to navigate into the `tests` directory manually. It ensures that all necessary dependencies and configurations are properly handled before invoking the corresponding commands in the `tests` Makefile. | ||
|  | ||
| ### Variables explained | ||
|  | ||
| - **TEST_TYPE**: The type of test to run (e.g., `ci-tests`, `e2e-tests`, `test-subset`, `test`). | ||
| - **TEST_OPTIONS**: Additional options to pass to the test command (e.g., `TEST=hello-world`) or `TESTS=hello-world,attached-connector`). | ||
| - **FORCE**: Force the creation of a new virtual environment, even if one already exists. | ||
|  | ||
| ### Available Commands | ||
|  | ||
| For example: | ||
|  | ||
| ```bash | ||
| # Run the ci-tests subset from the root | ||
| make tests-e2e ci-tests | ||
|  | ||
| # Run all E2E tests from the root | ||
| make tests-e2e e2e-tests | ||
| 
      Comment on lines
    
      +158
     to 
      +161
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be:  | ||
|  | ||
| # Run a specific test from the root | ||
| make test-e2e TEST_TYPE=test TEST_OPTIONS="TEST=hello-world" | ||
|  | ||
| # Run a specific test with a subset of tests from the root | ||
| make test-e2e TEST_TYPE=test-subset TEST_OPTIONS="TESTS=hello-world,attached-connector" | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason for my first comment is that it feels too complex to run samples like this one... | ||
| ``` | ||
|  | ||
| This abstraction ensures a consistent and streamlined workflow for running tests across the repository. | ||
|  | ||
| ## Core Ansible Collections | ||
|  | ||
| The tests rely on the following Ansible collections: | ||
|  | ||
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of making it simpler, by introducing just one variable, like
E2E_OPTIONS ?= ci-tests?With that, the
test-e2etarget below, could be simplified into something like:And the execution could be done as: