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

Address edge case scenarios during the updating of TestPlanVersion phase with old TestPlanVersion results #771

Merged
merged 7 commits into from
Sep 28, 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
1 change: 1 addition & 0 deletions .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
yarn sequelize:test db:migrate
yarn sequelize:test db:seed:all
yarn workspace server db-import-tests:test -c ${IMPORT_ARIA_AT_TESTS_COMMIT_1}
yarn workspace server db-import-tests:test -c ${IMPORT_ARIA_AT_TESTS_COMMIT_2}
yarn workspace server db-import-tests:test
yarn workspace server db-populate-sample-data:test
- name: test
Expand Down
55 changes: 18 additions & 37 deletions client/components/DataManagement/DataManagementRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -636,18 +636,14 @@ const DataManagementRow = ({
}

let coveredReports = [];
let finalReportFound = false;

latestVersion.testPlanReports.forEach(testPlanReport => {
const markedFinalAt = testPlanReport.markedFinalAt;
const atName = testPlanReport.at.name;
const browserName = testPlanReport.browser.name;
const value = `${atName}_${browserName}`;

if (markedFinalAt && !coveredReports.includes(value)) {
finalReportFound = true;
if (markedFinalAt && !coveredReports.includes(value))
coveredReports.push(value);
}
});

// Phase is "active"
Expand All @@ -667,38 +663,23 @@ const DataManagementRow = ({
className="advance-button"
variant="secondary"
onClick={async () => {
if (finalReportFound) {
setShowAdvanceModal(true);
setAdvanceModalData({
phase: derivePhaseName(
'CANDIDATE'
),
version: convertDateToString(
latestVersionDate,
'YY.MM.DD'
),
advanceFunc: () => {
setShowAdvanceModal(false);
handleClickUpdateTestPlanVersionPhase(
latestVersion.id,
'CANDIDATE',
testPlanVersionDataToInclude
);
},
coveredReports
});
} else {
setShowThemedModal(true);
setThemedModalTitle(
'Error Updating Test Plan Version Phase'
);
setThemedModalContent(
<>
No reports have been marked
as final.
</>
);
}
setShowAdvanceModal(true);
setAdvanceModalData({
phase: derivePhaseName('CANDIDATE'),
version: convertDateToString(
latestVersionDate,
'YY.MM.DD'
),
advanceFunc: () => {
setShowAdvanceModal(false);
handleClickUpdateTestPlanVersionPhase(
latestVersion.id,
'CANDIDATE',
testPlanVersionDataToInclude
);
},
coveredReports
});
}}
>
Advance to Candidate
Expand Down
3 changes: 2 additions & 1 deletion config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ ENVIRONMENT=test
ALLOW_FAKE_ROLE=true
IMPORT_CONFIG=../config/test.env

IMPORT_ARIA_AT_TESTS_COMMIT_1=1aa3b74d24d340362e9f511eae33788d55487d12
IMPORT_ARIA_AT_TESTS_COMMIT_1=5fe7afd82fe51c185b8661276105190a59d47322
IMPORT_ARIA_AT_TESTS_COMMIT_2=1aa3b74d24d340362e9f511eae33788d55487d12

GITHUB_OAUTH_SERVER=http://localhost:4466
GITHUB_GRAPHQL_SERVER=http://localhost:4466
Expand Down
18 changes: 13 additions & 5 deletions docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
The database migrations are managed by [Sequelize](https://sequelize.org/). To read and understand the schema, see the Sequelize models that represent the data in `server/models`. Each model represents a table in the database.

## Setting up a local database for development

0. Install PostgreSQL
- Mac
- Mac
```
brew install postgresql@14
brew services start postgresql@14
Expand All @@ -30,7 +31,9 @@ The database migrations are managed by [Sequelize](https://sequelize.org/). To r
```
4. Import the most recent tests from the [aria-at repository](https://github.com/w3c/aria-at):
```
yarn db-import-tests:dev
yarn db-import-tests:dev -c 5fe7afd82fe51c185b8661276105190a59d47322;
yarn db-import-tests:dev -c 1aa3b74d24d340362e9f511eae33788d55487d12;
yarn db-import-tests:dev;
```

All at once:
Expand All @@ -45,6 +48,8 @@ fi;

yarn sequelize db:migrate;
yarn sequelize db:seed:all;
yarn db-import-tests:dev -c 5fe7afd82fe51c185b8661276105190a59d47322;
yarn db-import-tests:dev -c 1aa3b74d24d340362e9f511eae33788d55487d12;
yarn db-import-tests:dev;
```

Expand Down Expand Up @@ -87,16 +92,19 @@ The instructions are similar for the test database, with one extra step:
yarn db-init:test;
yarn sequelize:test db:migrate;
yarn sequelize:test db:seed:all;
yarn workspace server db-import-tests:test -c 5fe7afd82fe51c185b8661276105190a59d47322;
yarn workspace server db-import-tests:test -c 1aa3b74d24d340362e9f511eae33788d55487d12;
yarn workspace server db-import-tests:test;
yarn workspace server db-populate-sample-data:test;
```

### Inspecting the database

To connect to the Postgres table locally:
```
yarn run dotenv -e config/dev.env psql
```

```
yarn run dotenv -e config/dev.env psql
```

## Application development: modifications to the schema

Expand Down
Loading