Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023-10-21 | MAIN --> PROD | DEV (2ab4b68) --> STAGING #2584

Merged
merged 3 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/deploy-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ jobs:
with:
url: "https://fac-dev.app.cloud.gov/"

generate-e2e-test-data:
needs:
- deploy-dev
name:
uses: ./.github/workflows/end-to-end-test-data-generator.yml
secrets: inherit
with:
environment: "dev"
9 changes: 9 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ jobs:
with:
url: "https://fac-staging.app.cloud.gov"
environment: "staging"

generate-e2e-test-data:
needs:
- deploy-staging
name:
uses: ./.github/workflows/end-to-end-test-data-generator.yml
secrets: inherit
with:
environment: "staging"
56 changes: 56 additions & 0 deletions .github/workflows/end-to-end-test-data-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: "Task: run Django command to generate and disseminate test data for non-production environments."
on:
workflow_dispatch:
inputs:
environment:
required: true
type: choice
description: The environment the workflow should run on.
options:
- dev
- staging
dbkeys:
required: false
type: string
description: Comma-separated list of report-IDs.
years:
required: false
type: string
description: Comma-separated list of report years. The list of years needs to be the same lenght as the list of dbkeys.
workflow_call:
inputs:
environment:
required: true
type: string
description: The environment the workflow should run on.
# dev, staging
dbkeys:
required: false
type: string
description: Comma-separated list of report-IDs.
years:
required: false
type: string
description: Comma-separated list of report years. The list of years needs to be the same lenght as the list of dbkeys.

jobs:
end-to-end-test-data:
name: Generate and disseminate end-to-end test data in ${{ inputs.environment }} database
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
space: ${{ inputs.environment }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run Django command to generate and disseminate end-to-end test data in ${{ inputs.environment }}
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: gsa-tts-oros-fac
cf_space: ${{ env.space }}
command: cf run-task gsa-fac -k 2G -m 2G --name generate_e2e_data --command "python manage.py end_to_end_test_data_generator --dbkeys ${{ inputs.dbkeys }} --years ${{ inputs.years }}"
8 changes: 7 additions & 1 deletion backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@
),
}

POSTGREST = {"URL": env.str("POSTGREST_URL", "http://api:3000")}
POSTGREST = {
"URL": env.str("POSTGREST_URL", "http://api:3000"),
"LOCAL": env.str("POSTGREST_URL", "http://api:3000"),
"DEVELOPMENT": "https://api-dev.fac.gov",
"STAGING": "https://api-staging.fac.gov",
"PRODUCTION": "https://api.fac.gov",
}


# Password validation
Expand Down
59 changes: 8 additions & 51 deletions backend/cypress/e2e/additional-eins.cy.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookAdditionalEINs,
testWorkbookFederalAwards,
testWorkbookAdditionalEINs,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Additional EINs page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Additional EINs uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Additional EINs uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Additional EINs").click();
testWorkbookAdditionalEINs(false);
});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Additional EINs');
});

});
});
59 changes: 8 additions & 51 deletions backend/cypress/e2e/additional-ueis.cy.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookAdditionalUEIs,
testWorkbookFederalAwards,
testWorkbookAdditionalUEIs,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Additional UEIs page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Additional UEIs uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Additional UEIs uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Additional UEIs").click();
testWorkbookAdditionalUEIs(false);
});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Additional UEIs');
});

});
});
55 changes: 6 additions & 49 deletions backend/cypress/e2e/audit-findings-text.cy.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookFederalAwards,
testWorkbookFindingsText,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Audit Findings Text page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Audit Findings Text uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get(".usa-link").contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Audit Findings Text uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Federal Awards Audit Findings Text").click();
testWorkbookFindingsText(false);
});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Federal Awards Audit Findings Text');
});

});
59 changes: 6 additions & 53 deletions backend/cypress/e2e/audit-findings.cy.js
Original file line number Diff line number Diff line change
@@ -1,69 +1,22 @@
import 'cypress-file-upload';
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
//import { testLogoutGov } from '../support/logout-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
import { testValidAuditeeInfo } from '../support/auditee-info.js';
import { testValidGeneralInfo } from '../support/general-info.js';
import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js';
import { testFederalAwards } from '../support/federal-awards.js';
import { testFileUploadMsg } from '../support/file-uploaded-msg.js';

import { testLoginGovLogin } from '../support/login-gov.js';
import {
testWorkbookFederalAwards,
testWorkbookFindingsUniformGuidance,
} from '../support/workbook-uploads.js';

const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE');
const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE');
const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE');

describe('Audit Findings page', () => {
before(() => {
cy.session('login-session', () => {
cy.visit('/');
cy.login();
});
});

it('Audit Findings uploads successfully', () => {
cy.visit('/');

cy.url().should('include', '/');
testLoginGovLogin();
});

cy.get('label[for=check-start-new-submission]').click();

cy.get('.usa-button').contains('Accept and start').click();

cy.url().should('match', /\/report_submission\/eligibility\/$/);

testValidEligibility();

testValidAuditeeInfo();

testValidAccess();

// Report should not yet be in the dissemination table
cy.url().then(url => {
const reportId = url.split('/').pop();
testReportIdNotFound(reportId);
});

testValidGeneralInfo();

cy.get('.usa-link').contains("Federal Awards").click();
testWorkbookFederalAwards(false);

it('Audit Findings uploads successfully', () => {
testFederalAwards();
cy.get(".usa-link").contains("Federal Awards Audit Findings").click();
testWorkbookFindingsUniformGuidance(false);

});

it('Displays message if file has already been uploaded', () => {
testFileUploadMsg('Edit the Federal Awards Audit Findings');
});

});



Loading
Loading