11---
2- name : Unit Tests
2+ name : Tests
33env :
44 DEFAULT_SAMPLES_REVISION : 10.2.4
55 DEFAULT_KHIOPS_DESKTOP_REVISION : 10.2.4
1515 khiops-desktop-revision :
1616 default : 10.2.4
1717 description : Khiops Windows Desktop Application Version
18- run-long -tests :
18+ run-expensive -tests :
1919 type : boolean
2020 required : false
2121 default : false
22- description : Execute long tests
22+ description : Execute expensive tests
2323 pull_request :
2424 paths :
2525 - khiops/**.py
@@ -110,9 +110,43 @@ jobs:
110110 rm -rf khiops.egg-info
111111 done
112112 - name : Prepare Unit Tests Environment
113- if : github.ref != 'dev' && github.ref != 'main' && ! inputs.run-long-tests
114- run : echo "UNITTEST_ONLY_SHORT_TESTS=true" >> "$GITHUB_ENV"
115- - name : Run Unit Tests
113+ if : github.ref != 'dev' && github.ref != 'main' && ! inputs.run-expensive-tests
114+ run : echo "SKIP_EXPENSIVE_TESTS=true" >> "$GITHUB_ENV"
115+ - name : Prepare Integration Tests on remote files
116+ env :
117+ AWS_ENDPOINT_URL : http://localhost:4569
118+ shell : bash
119+ run : |
120+ # Prepare AWS-S3 credentials and configuration
121+ mkdir -p ${GITHUB_WORKSPACE}/.aws/
122+ cat << EOF > ${GITHUB_WORKSPACE}/.aws/credentials
123+ [default]
124+ aws_access_key_id=KEY
125+ aws_secret_access_key=SECRET
126+ EOF
127+ cat << EOF > ${GITHUB_WORKSPACE}/.aws/configuration
128+ [default]
129+ endpoint_url=${AWS_ENDPOINT_URL}
130+ region=eu-north-1
131+ EOF
132+ echo "Generated AWS credentials..."
133+ cat ${GITHUB_WORKSPACE}/.aws/credentials
134+ echo "Generated AWS configuration..."
135+ cat ${GITHUB_WORKSPACE}/.aws/configuration
136+ /scripts/run_fake_remote_file_servers.sh . # launch the servers in the background
137+ - name : Authenticate to GCP using "Workload Identity Federation"
138+ # For integration tests on GCS we use a real Google account
139+ # Retrieve the Google credentials through "Workload Identity Federation"
140+ # see https://github.com/google-github-actions/auth?tab=readme-ov-file#workload-identity-federation-through-a-service-account
141+ uses : google-github-actions/auth@v2
142+ with :
143+ service_account : khiops-gcs-driver-test-sa@ino-olr-dak-ideal-sbx.iam.gserviceaccount.com
144+ workload_identity_provider : projects/322269704080/locations/global/workloadIdentityPools/github/providers/my-repo
145+ # 'create_credentials_file' is true by default but let's make it explicit
146+ # After authentication, the required GOOGLE_APPLICATION_CREDENTIALS environment variable is exported
147+ # https://github.com/google-github-actions/auth?tab=readme-ov-file#inputs-miscellaneous
148+ create_credentials_file : true
149+ - name : Run Unit & Integration Tests
116150 env :
117151 KHIOPS_SAMPLES_DIR : ${{ github.workspace }}/khiops-samples
118152 KHIOPS_DOCKER_RUNNER_URL : https://localhost:11000
@@ -124,6 +158,16 @@ jobs:
124158 rmaps_base_oversubscribe : true
125159 # Oversubscribe for MPI > 4.x
126160 OMPI_MCA_rmaps_base_oversubscribe : true
161+ # for the tests with GCS
162+ GCS_BUCKET_NAME : data-test-khiops-driver-gcs/khiops_data
163+ GCS_DRIVER_LOGLEVEL : info # set to debug for diagnosis
164+ # for the tests with S3
165+ S3_DRIVER_LOGLEVEL : info # set to debug for diagnosis
166+ S3_BUCKET_NAME : s3-bucket
167+ AWS_SHARED_CREDENTIALS_FILE : ${{ github.workspace }}/.aws/credentials
168+ AWS_CONFIG_FILE : ${{ github.workspace }}/.aws/configuration
169+ # Var for tests with S3
170+ no_proxy : localhost
127171 run : |
128172 # This is needed so that the Git tag is parsed and the khiops-python
129173 # version is retrieved
@@ -138,10 +182,10 @@ jobs:
138182 $CONDA run --no-capture-output -n "$CONDA_ENV" coverage report -m
139183 $CONDA run --no-capture-output -n "$CONDA_ENV" coverage xml -o "reports/$CONDA_ENV/py-coverage.xml"
140184 done
141- - name : Display Unit Test Reports
185+ - name : Display Test Reports
142186 uses : dorny/test-reporter@v1
143187 with :
144- name : Unit Tests ${{ matrix.python-version }}
188+ name : Run Tests ${{ matrix.python-version }}
145189 path : >-
146190 reports/py${{ matrix.python-version }}/TEST-tests.*.*.xml,
147191 reports/py${{ matrix.python-version }}_conda/TEST-tests.*.*.xml
0 commit comments