dididy opened a new pull request, #5088:
URL: https://github.com/apache/zeppelin/pull/5088

   ### What is this PR for?
   Currently, Zeppelin’s E2E authentication tests require the presence of a 
`shiro.ini` file to run.  
   However, in certain build or CI environments, this file may not exist.  
   In such cases, login tests may fail or behave unpredictably.  
   
   To improve flexibility, the test framework should support both scenarios:  
   - **Auth mode (`shiro.ini` exists)** → Run all tests, including 
authentication/login tests  
   - **Anonymous mode (`shiro.ini` does not exist)** → Skip 
authentication/login tests, but run all other tests  
   
   #### 1. GitHub Actions Workflow (Matrix Mode)
   - Added `strategy.matrix.mode: [anonymous, auth]`
   - In `auth` mode, copy `shiro.ini.template → shiro.ini`
   - In `anonymous` mode, skip `shiro.ini` setup to simulate a no-auth 
environment
   
   #### 2. Playwright Global Setup / Teardown
   - **`global-setup.ts`**
     - Added `LoginTestUtil.isShiroEnabled()` to detect presence of `shiro.ini`
     - If enabled → load credentials & run login tests  
     - If disabled → skip login tests, log message  
   - **`global-teardown.ts`**
     - Added environment cleanup (e.g., reset cache)
   
   #### 3. Authentication Utility (`login-page.util.ts`)
   - `isShiroEnabled()`: Checks if `shiro.ini` is accessible via `fs.access`
   - `getTestCredentials()`: Parses credentials only when `shiro.ini` exists
   - `resetCache()`: Clears cached values between test runs
   
   #### 4. Test Code Updates
   - **`app.spec.ts`**  
     - Conditionally checks whether login page or workspace should be visible, 
based on `isShiroEnabled()`
   - **Other Playwright tests**  
     - Authentication-related tests are skipped when `shiro.ini` is not present
   
   ### What type of PR is it?
   Improvement
   
   ### Todos
   
   ### What is the Jira issue?
   ZEPPELIN-6336
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the license files need to update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to