Skip to content

Commit

Permalink
Merge pull request #25 from pagopa/fix-integration-tests-environment
Browse files Browse the repository at this point in the history
fix: Integration tests
  • Loading branch information
gioelemella authored Jan 20, 2025
2 parents 4823a78 + 3e85106 commit 7bd8e91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 38 deletions.
40 changes: 3 additions & 37 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ permissions:

jobs:
integration_test:
name: Test ${{(github.event.inputs == null && 'dev') || inputs.environment }}
name: Test ${{(github.event.inputs == null && 'uat') || inputs.environment }}
runs-on: ubuntu-latest
environment: ${{(github.event.inputs == null && 'dev') || inputs.environment }}
environment: ${{(github.event.inputs == null && 'uat') || inputs.environment }}
steps:
- name: Checkout
id: checkout
Expand Down Expand Up @@ -78,38 +78,4 @@ jobs:
message_format: '{emoji} <{run_url}|{workflow}> {status_message} in <{repo_url}|{repo}> in ${{ inputs.environment }}'
footer: 'Linked to <{workflow_url}| workflow file>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

delete_github_deployments:
runs-on: ubuntu-latest
needs: integration_test
if: ${{ always() }}
steps:
- name: Delete Previous deployments
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
env:
SHA_HEAD: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha}}
with:
script: |
const { SHA_HEAD } = process.env
const deployments = await github.rest.repos.listDeployments({
owner: context.repo.owner,
repo: context.repo.repo,
sha: SHA_HEAD
});
await Promise.all(
deployments.data.map(async (deployment) => {
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id,
state: 'inactive'
});
return github.rest.repos.deleteDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id
});
})
);
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const assert = require('assert');
const { Given, When, Then, After } = require('@cucumber/cucumber');
const { Given, When, Then, After, setDefaultTimeout } = require('@cucumber/cucumber');
const {getMDB, getMdbReceipt, getBody, getPayPosition, payReceipt, getDebtPositions, deleteDebtPosition} = require("./common.js");

// set timeout for Hooks function, it allows to wait for long task
setDefaultTimeout(15 * 1000);

var fiscalCodeEC = process.env.FISCAL_CODE_EC;
var receiptNav = process.env.CORRECT_NAV;

Expand Down

0 comments on commit 7bd8e91

Please sign in to comment.