|
74 | 74 | submodules: true |
75 | 75 | - name: Install dependencies |
76 | 76 | run: | |
| 77 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com |
| 78 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com |
77 | 79 | curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 |
78 | 80 | poetry install |
79 | 81 | poetry run pytest -v tests/unit |
|
99 | 101 | run: | |
100 | 102 | mkdir test-results-${{ matrix.splunk.version }} |
101 | 103 | - name: Test |
| 104 | + env: |
| 105 | + GH_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }} |
102 | 106 | run: | |
103 | 107 | export SPLUNK_APP_PACKAGE=./tests/e2e/addons/TA_fiction_indextime |
104 | 108 | export SPLUNK_ADDON=TA_fiction_indextime |
@@ -159,14 +163,105 @@ jobs: |
159 | 163 | with: |
160 | 164 | python-version: 3.7 |
161 | 165 | - run: | |
| 166 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com |
| 167 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com |
162 | 168 | curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 |
163 | 169 | poetry install |
164 | 170 | poetry run pytest -v --splunk-version=${{ matrix.splunk.version }} -m docker -m ${{ matrix.test-marker }} tests/e2e |
| 171 | + env: |
| 172 | + GH_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }} |
| 173 | +
|
| 174 | + # --------------------------------------------------------------------------- |
| 175 | + # Validate PSA against multiple splunk-cim-models package versions. |
| 176 | + # |
| 177 | + # Matrix axes: |
| 178 | + # splunk – every supported Splunk version (from meta job) |
| 179 | + # cim-models – every package git ref listed below |
| 180 | + # |
| 181 | + # How to add a new CIM models release: |
| 182 | + # 1. Append a new entry to the cim-models list with the git ref (branch |
| 183 | + # or tag) and a short human-readable label. |
| 184 | + # 2. The matrix will automatically run the splunk_cim_model e2e test |
| 185 | + # for each (Splunk version, CIM models version) combination. |
| 186 | + # |
| 187 | + # Only the splunk_cim_model marker is used here because the other CIM |
| 188 | + # e2e markers (splunk_app_cim_fiction, splunk_app_cim_broken) always pass |
| 189 | + # --splunk-dm-path with custom fiction models and are therefore unaffected |
| 190 | + # by the installed splunk-cim-models version. |
| 191 | + # --------------------------------------------------------------------------- |
| 192 | + test-cim-models-versions: |
| 193 | + needs: |
| 194 | + - meta |
| 195 | + - pre-commit |
| 196 | + - fossa-scan |
| 197 | + - compliance-copyrights |
| 198 | + - test-splunk-unit |
| 199 | + runs-on: ubuntu-22.04 |
| 200 | + strategy: |
| 201 | + fail-fast: false |
| 202 | + matrix: |
| 203 | + splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }} |
| 204 | + cim-models: |
| 205 | + - ref: "v1" |
| 206 | + label: "1.x" |
| 207 | + - ref: "v2" |
| 208 | + label: "2.x" |
| 209 | + # Add future releases here, e.g.: |
| 210 | + # - ref: "v3" |
| 211 | + # label: "3.x" |
| 212 | + name: "CIM models ${{ matrix.cim-models.label }} / Splunk ${{ matrix.splunk.version }}" |
| 213 | + steps: |
| 214 | + - uses: actions/checkout@v4 |
| 215 | + with: |
| 216 | + submodules: true |
| 217 | + - uses: actions/setup-python@v5 |
| 218 | + with: |
| 219 | + python-version: "3.7" |
| 220 | + - name: Install PSA with CIM models ${{ matrix.cim-models.label }} |
| 221 | + env: |
| 222 | + GH_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }} |
| 223 | + run: | |
| 224 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com |
| 225 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com |
| 226 | + curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 |
| 227 | + poetry install |
| 228 | + # Override the dev-dependency CIM models with the matrix version. |
| 229 | + # Using pip inside the Poetry venv so the pytester subprocess sees |
| 230 | + # the same environment. |
| 231 | + poetry run pip install \ |
| 232 | + "git+https://github.com/splunk/psa-cim-models.git@${{ matrix.cim-models.ref }}" |
| 233 | + - name: Verify splunk-cim-models ${{ matrix.cim-models.label }} |
| 234 | + run: | |
| 235 | + poetry run python - <<'EOF' |
| 236 | + import splunk_cim_models as scm |
| 237 | + print("DATA_MODELS_PATH:", scm.DATA_MODELS_PATH) |
| 238 | + print("CIM versions available:", list(scm.datamodels.keys())) |
| 239 | + EOF |
| 240 | + - name: Run CIM compatibility e2e tests |
| 241 | + env: |
| 242 | + GH_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }} |
| 243 | + run: | |
| 244 | + # splunk_app_cim_fiction uses --splunk-dm-path with local fiction |
| 245 | + # data models, so expected test outcomes are identical across all |
| 246 | + # splunk-cim-models versions. It still exercises all PSA import |
| 247 | + # paths (COMMON_FIELDS_PATH, DATAMODEL_SCHEMA_PATH, datamodels) so |
| 248 | + # an incompatible package version will surface as a collection or |
| 249 | + # runtime error rather than a wrong-field assertion. |
| 250 | + # |
| 251 | + # splunk_cim_model (real Change/Network_Traffic models) is left to |
| 252 | + # test-splunk-matrix, which always uses the default v2 dev |
| 253 | + # dependency and asserts version-specific field outcomes. |
| 254 | + poetry run pytest -v \ |
| 255 | + --splunk-version=${{ matrix.splunk.version }} \ |
| 256 | + -m docker \ |
| 257 | + -m splunk_app_cim_fiction \ |
| 258 | + tests/e2e |
165 | 259 |
|
166 | 260 | publish: |
167 | 261 | needs: |
168 | 262 | - test-splunk-external |
169 | 263 | - test-splunk-matrix |
| 264 | + - test-cim-models-versions |
170 | 265 | runs-on: ubuntu-22.04 |
171 | 266 | steps: |
172 | 267 | - uses: actions/checkout@v4 |
|
0 commit comments