Skip to content

Commit

Permalink
Implement end to end tests and solve several bugs (#34)
Browse files Browse the repository at this point in the history
* Set up Playwright and copy Home Assistant config folder

* Create tests

* Solve multiple bugs during testing and increase coverage

* Increase coverage up to 100%

* Create workflows for the end-to-end tests

* Remove the yaml bundle from gitignore because it is not generated

* Ignore the sidebar-config.json file

* Cache docker images

* Save tests artifacts

* Restore sidebar-config.json

* Fix one test
  • Loading branch information
elchininet committed Feb 10, 2024
1 parent 00d731c commit fb84103
Show file tree
Hide file tree
Showing 74 changed files with 4,878 additions and 95 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,23 @@ jobs:
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: dependencies-v1-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Cache Docker images
uses: ScribeMD/docker-cache@0.3.6
with:
key: docker-v1-${{ runner.os }}-${{ hashFiles('.hass/config/.HA_VERSION', '.playwright_docker_version') }}
- name: Install deps
run: yarn install --frozen-lockfile
- name: Tests
run: yarn test:ts
- name: E2E tests
run: |
touch .env
echo HA_TOKEN=${{ secrets.HA_TOKEN }} >> .env
yarn test:all
- name: Create coverage
run: yarn coverage:report
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,28 @@ jobs:
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: dependencies-v1-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Cache Docker images
uses: ScribeMD/docker-cache@0.3.6
with:
key: docker-v1-${{ runner.os }}-${{ hashFiles('.hass/config/.HA_VERSION', '.playwright_docker_version') }}
- name: Install
run: yarn install --frozen-lockfile
- name: Tests
run: yarn test:ts
- name: E2E tests
run: |
touch .env
echo HA_TOKEN=${{ secrets.HA_TOKEN }} >> .env
yarn test:all
- name: Create coverage
run: yarn coverage:report
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-report
path: |
playwright-report/
coverage/
retention-days: 30
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/node_modules
/dist
/.yalc
/yalc.lock
/yalc.lock
.DS_Store
.hass/config/www/custom-sidebar.js
/.nyc_output
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/coverage
/.env
1 change: 1 addition & 0 deletions .hass/config/.HA_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024.1.6
24 changes: 24 additions & 0 deletions .hass/config/.storage/assist_pipeline.pipelines
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": 1,
"minor_version": 2,
"key": "assist_pipeline.pipelines",
"data": {
"items": [
{
"conversation_engine": "homeassistant",
"conversation_language": "en",
"id": "01hfsxav88enscr7b5majn3ak6",
"language": "en",
"name": "Home Assistant",
"stt_engine": null,
"stt_language": null,
"tts_engine": "google_translate",
"tts_language": "en-us",
"tts_voice": null,
"wake_word_entity": null,
"wake_word_id": null
}
],
"preferred_item": "01hfsxav88enscr7b5majn3ak6"
}
}
Loading

0 comments on commit fb84103

Please sign in to comment.