// Real-world fixture — derived from:
//   snowflakedb/universal-driver — ci/Jenkinsfile.coverage
//   https://github.com/snowflakedb/universal-driver
//
// Purpose: exercises two rules on the same Jenkinsfile:
//   SEC3-JK-004 — pip install --extra-index-url without --index-url
//                 (dep-confusion class, PyTorch Dec 2022)
//   SEC8-JK-004 — Docker agent / .inside() with --privileged
//                 (container escape primitive)
//
// The real Jenkinsfile is under ``ci/``, which the pre-fix engine
// discovery missed — PR #86 widened the glob to ``**/Jenkinsfile.*``.
// This fixture also demonstrates the discovery-fix is still working.
pipeline {
    agent any
    stages {
        stage('Install') {
            steps {
                sh 'pip install --extra-index-url https://artifactory.ci1.us-west-2.aws-dev.app.snowflake.com/api/pypi/pypi/simple benchstore-client-library'
            }
        }
        stage('Coverage') {
            steps {
                script {
                    docker.image(env.DOCKER_IMAGE).inside('-u root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
                        sh './run-coverage.sh'
                    }
                }
            }
        }
    }
}
