Skip to content

Commit 56e317b

Browse files
authored
Add steps for ensuring pre-commit hooks are installed (#416)
* Add steps for ensuring pre-commit hooks are installed * Add .idea folder to gitignore * Add steps for running tests and linters/formatters * Retain trace logs on failure Allows us to better debug why the tests just occasionally fail * Add tracing to playwright tests * Run tracing action regardless of test status * Fix folder where test results will upload * Use proper tests dir * Actually turn on tracing and upload the resulting failed results * Use jekyll serve detach command I somehow missed that the command existed * Add macos, jetbranins and vscode to gitignore * Remove sleep fixture Playwright has a built-in "slowmo" feature that would be easiest to use. https://playwright.dev/python/docs/test-runners#cli-arguments * Use standard python comparison operator The `to_equal` doesn't seem to exist in playwright for python. There is a NodeJS equivalent, but there is no supported GenericAssertion equivalent for python https://playwright.dev/docs/api/class-genericassertions * Add explanation to test assertion * Fix linting issues * Pull upstream changes * Use white theme for images * Remake changes in CONTRIBUTING file * Remove unneeded test-results folder * Revert .gitignore * Revert to base readme * Use white theme to stay consistent * Increase GH action job to 30 mins * Run linter to fix linting errors
1 parent 6b9cb6f commit 56e317b

10 files changed

+52
-17
lines changed

.github/workflows/conference.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ jobs:
5555
automated pr
5656
add_comment:
5757
runs-on: ubuntu-latest
58-
58+
5959
steps:
60-
- name: Add comment to the issue
61-
uses: actions/github-script@v6
62-
if: ${{ github.event.issue.user.type != 'User' }} #adds comment only if the issue is created by a bot
63-
with:
64-
github-token: ${{ secrets.GITHUB_TOKEN }}
65-
script: |
66-
const issueNumber = context.payload.issue.number;
67-
const comment = "Automated issue, no action is required."
68-
69-
github.issues.createComment({
70-
...context.repo,
71-
issue_number: issueNumber,
72-
body: comment
73-
});
60+
- name: Add comment to the issue
61+
uses: actions/github-script@v6
62+
if: ${{ github.event.issue.user.type != 'User' }} #adds comment only if the issue is created by a bot
63+
with:
64+
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
script: |
66+
const issueNumber = context.payload.issue.number;
67+
const comment = "Automated issue, no action is required."
68+
69+
github.issues.createComment({
70+
...context.repo,
71+
issue_number: issueNumber,
72+
body: comment
73+
});

.github/workflows/playwright.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
jobs:
1515
test:
16+
timeout-minutes: 30
1617
runs-on: ubuntu-latest
1718
steps:
1819
- uses: actions/checkout@v3

CONTRIBUTING.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ Follow these steps and note these guidelines to begin contributing:
5858

5959
![Bundle install terminal](/assets/images/bundle_install_terminal.png)
6060

61-
- After installing the dependencies, its time to run the application. We do this by running the command `bundle exec jekyll serve` or run the default **Build Task** <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd>:
61+
- Afterwards, run the command `pip install -r requirements-dev.txt` to install the python dev dependencies.
62+
63+
![Pip install terminal](/assets/images/pip_install_terminal.png)
64+
65+
- Install the pre-commit hooks to automatically format the code before committing. Run the command `pre-commit install`:
66+
67+
![Pre-commit install terminal](/assets/images/pre-commit_install_terminal.png)
68+
69+
- After installing the dependencies, its time to run the application. We do this by running the command `bundle exec jekyll serve --detach` or run the default **Build Task** <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd>:
6270

6371
![Jekyll serve terminal](/assets/images/jekyll_serve_terminal.png)
6472

@@ -70,6 +78,32 @@ Follow these steps and note these guidelines to begin contributing:
7078

7179
![Running page](/assets/images/running_page.png)
7280

73-
- Test your changes (create new tests as needed)
81+
### Testing Changes (create new tests as needed)
82+
83+
- To run the test suites for the codebase
84+
85+
- Ensure the site is running locally with `bundle exec jekyll serve --detach`. This will run the server in the background, and any content changes will immediately reflect on the site.
86+
87+
![Jekyll serve terminal](/assets/images/jekyll_serve_terminal.png)
88+
89+
- If you need to restart the server, you can run `pkill -f jekyll` to stop the server and then run `bundle exec jekyll serve --detach` to start the server again.
90+
91+
- Run all tests in the test-suite with the command `python3 -m pytest`:
92+
93+
![Pytest terminal](/assets/images/pytest_run_terminal.png)
94+
95+
### Pushing Changes
96+
97+
- Run `pre-commit run --all` to ensure your code is formatted and linted correctly before pushing your changes.
98+
99+
![Pre-commit run terminal](/assets/images/pre-commit_run_terminal.png)
100+
101+
- Run `git commit -m "<Your commit message>"` to commit your changes.
102+
103+
![Git commit terminal](/assets/images/git_commit_terminal.png)
104+
105+
- Finally run `git push origin <your-branch-name>` to push your changes to your fork.
106+
107+
![Git push terminal](/assets/images/git_push_terminal.png)
74108

75109
- Once you’ve committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. Please ensure that you compare your feature branch to the desired branch of the repo you are supposed to make a PR to. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes in your development branch and update it. 🥳

assets/images/git_commit_terminal.png

40.7 KB
Loading

assets/images/git_push_terminal.png

37.6 KB
Loading
122 KB
Loading
51.3 KB
Loading
54.9 KB
Loading
105 KB
Loading

assets/images/pytest_run_terminal.png

242 KB
Loading

0 commit comments

Comments
 (0)