Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Apr 24, 2024
2 parents aeac309 + 3d050fa commit 1e71417
Show file tree
Hide file tree
Showing 305 changed files with 2,157 additions and 4,374 deletions.
122 changes: 20 additions & 102 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
id: cache
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
restore-keys: ${{ runner.os }}-node_modules-
- name: Get yarn cache directory path
if: steps.cache.outputs.cache-hit != 'true'
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# Use week number for automatically purging the cache every week. This is
# useful because caching yarn-cache would otherwise lead it to grow
# indefinitely since old dependencies are never purged.
- name: Get week number
if: steps.cache.outputs.cache-hit != 'true'
id: week-number
run: echo "value=$(date +%W)" >> $GITHUB_OUTPUT
- name: Cache "yarn-cache"
uses: martijnhols/actions-cache@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ steps.week-number.outputs.value }}-yarn-cache-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ steps.week-number.outputs.value }}-yarn-cache-
- run: yarn --frozen-lockfile --prefer-offline
if: steps.cache.outputs.cache-hit != 'true'
- name: Save "node_modules" in cache
if: steps.cache.outputs.cache-hit != 'true'
uses: martijnhols/actions-cache/save@v3
with:
path: |
node_modules
key: ${{ steps.cache.outputs.primary-key }}

# TODO: Update this when possible to include the node_modules folder. GH is updating artifact action soon to make this
# easier (https://github.com/actions/upload-artifact/issues/7#issuecomment-566114993), and cache action multiple path
# support is popular (https://github.com/actions/cache/issues/16)
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline

typecheck:
needs: [prepare]
Expand All @@ -65,13 +28,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn typecheck

linting:
Expand All @@ -83,13 +41,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn lint --max-warnings=0

prettier:
Expand All @@ -101,13 +54,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn prettier . --check

test-interface:
Expand All @@ -120,13 +68,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn test:interface

test-parser:
Expand All @@ -138,13 +81,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn test:parser

build:
Expand All @@ -159,13 +97,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- name: Extract messages
if: github.event_name != 'pull_request' && github.repository == 'wowanalyzer/wowanalyzer'
run: |
Expand Down Expand Up @@ -196,13 +129,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- name: Extract messages
run: |
yarn extract
Expand Down Expand Up @@ -240,13 +168,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/download-artifact@v3
with:
name: e2e-build
Expand Down Expand Up @@ -275,13 +198,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Restore "node_modules" from cache
uses: martijnhols/actions-cache/restore@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json', 'yarn.lock') }}-v3
required: true
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- name: Extract messages
run: yarn extract
- name: Compile messages
Expand Down
75 changes: 36 additions & 39 deletions e2e/report-selection.spec.ts
Original file line number Diff line number Diff line change
@@ -1,91 +1,92 @@
import { expect, test } from './fixtures';

const reportCode = 'akZLCTYbN2XpQFmg';
const reportTitle = 'SHATED';
const fightLinkName = 'Kill 5:44';
const fightUrlPart = '63-Mythic+Smolderon+-+Kill+(5:44)';
const fightPageTitle = `Mythic Smolderon - Kill (5:44) in ${reportTitle}`;
const playerLinkName = 'Toppledh Vengeance Demon Hunter Vengeance Demon Hunter 490';
const playerName = 'Toppledh';
const bossDifficultyAndName = 'MythicSmolderon';
const resultsPageTitle = `Mythic Smolderon - Kill (5:44) by ${playerName} in ${reportTitle}`;

test('report selection', async ({ page, homePage, fightSelectionPage }) => {
await homePage.goto();

await homePage.fillInReportInputWithCode('bjqrZRnNdvKPXt13');
await homePage.fillInReportInputWithCode(reportCode);

await fightSelectionPage.expectFightSelectionHeaderToBeVisible();
await fightSelectionPage.expectUrlToHaveReportCode('bjqrZRnNdvKPXt13');
await expect(page).toHaveTitle('owl time');
await fightSelectionPage.expectUrlToHaveReportCode(reportCode);
await expect(page).toHaveTitle(reportTitle);
});

test('fight selection', async ({ page, fightSelectionPage, playerSelectionPage }) => {
await fightSelectionPage.goto('bjqrZRnNdvKPXt13');
await fightSelectionPage.goto(reportCode);

await page.getByRole('link', { name: 'Kill 8:47' }).click();
await page.getByRole('link', { name: fightLinkName }).click();

await playerSelectionPage.expectPlayerSelectionHeaderToBeVisible();
await playerSelectionPage.expectUrlToHaveReportCodeAndFight(
'bjqrZRnNdvKPXt13',
'34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)',
);
await expect(page).toHaveTitle('Mythic Fyrakk the Blazing - Kill (8:47) in owl time');
await playerSelectionPage.expectUrlToHaveReportCodeAndFight(reportCode, fightUrlPart);
await expect(page).toHaveTitle(fightPageTitle);
});

test('player selection', async ({ page, playerSelectionPage, reportPage }) => {
await playerSelectionPage.goto('bjqrZRnNdvKPXt13', '34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)');
await playerSelectionPage.goto(reportCode, fightUrlPart);

await page
.getByRole('link', { name: 'Toppledh Vengeance Demon Hunter Vengeance Demon Hunter 488' })
.click();
await page.getByRole('link', { name: playerLinkName }).click();

await reportPage.expectBossDifficultyAndNameHeaderToBeVisible();
await reportPage.expectBossDifficultyAndNameHeaderToHaveText('MythicFyrakk, the Blazing');
await reportPage.expectUrlToHave(
'bjqrZRnNdvKPXt13',
'34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)',
'Toppledh',
);
await expect(page).toHaveTitle('Mythic Fyrakk the Blazing - Kill (8:47) by Toppledh in owl time');
await reportPage.expectBossDifficultyAndNameHeaderToHaveText(bossDifficultyAndName);
await reportPage.expectUrlToHave(reportCode, fightUrlPart, playerName);
await expect(page).toHaveTitle(resultsPageTitle);
});

test.describe('tab selection', () => {
test.beforeEach(async ({ reportPage }) => {
await reportPage.goto({
reportCode: 'bjqrZRnNdvKPXt13',
fightCode: '34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)',
playerName: 'Toppledh',
reportCode: reportCode,
fightCode: fightUrlPart,
playerName,
});
});

test('statistics', async ({ page, reportPage }) => {
await reportPage.clickOnStatisticsTab();

await expect(page).toHaveURL(
'/report/bjqrZRnNdvKPXt13/34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)/Toppledh/standard/statistics',
`/report/${reportCode}/${fightUrlPart}/${playerName}/standard/statistics`,
);
});

test('timeline', async ({ page, reportPage }) => {
await reportPage.clickOnTimelineTab();

await expect(page).toHaveURL(
'/report/bjqrZRnNdvKPXt13/34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)/Toppledh/standard/timeline',
`/report/${reportCode}/${fightUrlPart}/${playerName}/standard/timeline`,
);
});

test('cooldowns', async ({ page, reportPage }) => {
await reportPage.clickOnCooldownsTab();

await expect(page).toHaveURL(
'/report/bjqrZRnNdvKPXt13/34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)/Toppledh/standard/cooldowns',
`/report/${reportCode}/${fightUrlPart}/${playerName}/standard/cooldowns`,
);
});

test('character', async ({ page, reportPage }) => {
await reportPage.clickOnCharacterTab();

await expect(page).toHaveURL(
'/report/bjqrZRnNdvKPXt13/34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)/Toppledh/standard/character',
`/report/${reportCode}/${fightUrlPart}/${playerName}/standard/character`,
);
});

test('about', async ({ page, reportPage }) => {
await reportPage.clickOnAboutTab('Vengeance Demon Hunter');
await reportPage.clickOnAboutTab();

await expect(page).toHaveURL(
'/report/bjqrZRnNdvKPXt13/34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)/Toppledh/standard/about',
`/report/${reportCode}/${fightUrlPart}/${playerName}/standard/about`,
);
});
});
Expand All @@ -96,16 +97,12 @@ test('perform analysis', async ({ page }) => {
await page.getByPlaceholder('https://www.warcraftlogs.com/reports/<report code>').click();
await page
.getByPlaceholder('https://www.warcraftlogs.com/reports/<report code>')
.fill('https://www.warcraftlogs.com/reports/bjqrZRnNdvKPXt13');
.fill(`https://www.warcraftlogs.com/reports/${reportCode}`);
await page.getByRole('heading', { name: 'Fight selection' }).waitFor();
await page.getByRole('link', { name: 'Kill 8:47' }).click();
await page.getByRole('link', { name: fightLinkName }).click();
await page.getByRole('heading', { name: 'Player selection' }).waitFor();
await page
.getByRole('link', { name: 'Toppledh Vengeance Demon Hunter Vengeance Demon Hunter 488' })
.click();
await page.getByText('MythicFyrakk, the Blazing').waitFor();
await page.getByRole('link', { name: playerLinkName }).click();
await page.getByText(bossDifficultyAndName).waitFor();

await expect(page).toHaveURL(
'/report/bjqrZRnNdvKPXt13/34-Mythic+Fyrakk+the+Blazing+-+Kill+(8:47)/Toppledh/standard',
);
await expect(page).toHaveURL(`/report/${reportCode}/${fightUrlPart}/${playerName}/standard`);
});
4 changes: 4 additions & 0 deletions src/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import SpellLink from 'interface/SpellLink';

// prettier-ignore
export default [
change(date(2024, 4, 24), 'Bump for season 4 start.', ToppleTheNun),
change(date(2024, 4, 22), 'Clean up dead code using knip', Putro),
change(date(2024, 4, 20), 'Fix friendly/enemy determination', emallson),
change(date(2024, 4, 17), 'Add 10.2.7 patch.', ToppleTheNun),
change(date(2024, 4, 12), 'Fix mana level chart', emallson),
change(date(2024, 4, 10), 'Update paths used by Sentry.', ToppleTheNun),
change(date(2024, 4, 10), 'Update dependencies.', ToppleTheNun),
Expand Down
6 changes: 6 additions & 0 deletions src/CONTRIBUTORS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2400,3 +2400,9 @@ export const Humperella: Contributor = {
},
],
};

export const Saeldur: Contributor = {
nickname: 'Saeldur',
github: 'Saeldur',
discord: 'saeldur',
};
4 changes: 0 additions & 4 deletions src/analysis/classic/deathknight/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/druid/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Analyzer, { Options } from 'parser/core/Analyzer';
import { SELECTED_PLAYER } from 'parser/core/EventFilter';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events from 'parser/core/Events';
import SpellUsable from 'parser/shared/modules/SpellUsable';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AnyEvent } from 'parser/core/Events';
import { Info } from 'parser/core/metric';
import castCount from 'parser/shared/metrics/castCount';

export interface LowRankSpells {
interface LowRankSpells {
[primarySpellId: number]: number[];
}

Expand Down
Loading

0 comments on commit 1e71417

Please sign in to comment.