rspec_profiling 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/ISSUE_TEMPLATE/bug.yml +66 -0
  4. data/.github/ISSUE_TEMPLATE/config.yml +1 -0
  5. data/.github/ISSUE_TEMPLATE/docs.yml +18 -0
  6. data/.github/ISSUE_TEMPLATE/feature-request.yml +36 -0
  7. data/.github/ISSUE_TEMPLATE/question-support.yml +18 -0
  8. data/.github/PULL_REQUEST_TEMPLATE.md +17 -0
  9. data/.github/dependabot.yaml +20 -0
  10. data/.github/workflows/auto-assign-author.yaml +13 -0
  11. data/.github/workflows/codeql.yaml +43 -0
  12. data/.github/workflows/release.yaml +40 -0
  13. data/.github/workflows/stale.yaml +38 -0
  14. data/.github/workflows/test.yaml +54 -0
  15. data/.gitignore +3 -0
  16. data/.ruby-version +1 -1
  17. data/CODE_OF_CONDUCT.md +130 -0
  18. data/CONTRIBUTING.md +37 -0
  19. data/EMERITUS.md +3 -0
  20. data/{LICENSE.txt → LICENSE.md} +2 -1
  21. data/Makefile +60 -0
  22. data/README.md +61 -19
  23. data/SECURITY.md +20 -0
  24. data/docker-compose.yml +13 -0
  25. data/lib/rspec_profiling/collectors/csv.rb +30 -7
  26. data/lib/rspec_profiling/collectors/json.rb +70 -0
  27. data/lib/rspec_profiling/collectors/psql.rb +1 -1
  28. data/lib/rspec_profiling/collectors/sql.rb +1 -1
  29. data/lib/rspec_profiling/config.rb +4 -2
  30. data/lib/rspec_profiling/example.rb +23 -1
  31. data/lib/rspec_profiling/rspec.rb +1 -1
  32. data/lib/rspec_profiling/run.rb +33 -5
  33. data/lib/rspec_profiling/vcs/git.rb +1 -1
  34. data/lib/rspec_profiling/version.rb +1 -1
  35. data/lib/rspec_profiling.rb +14 -2
  36. data/rspec_profiling.gemspec +9 -6
  37. metadata +45 -35
  38. data/.ruby-gemset +0 -1
  39. data/rspec_profiling +0 -0
  40. data/spec/collectors/psql_spec.rb +0 -90
  41. data/spec/collectors/sql_spec.rb +0 -90
  42. data/spec/run_spec.rb +0 -151
  43. data/spec/vcs/git_spec.rb +0 -27
  44. data/spec/vcs/svn_spec.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24110d7ae61d04956ff76ff9e13c088c238a5fe66218d9e1aa4ef8a62bdbd9c6
4
- data.tar.gz: 44d1a03208cba2c4249cbc81b27657dc535157d8fbe7ae302e618645732aebb5
3
+ metadata.gz: 26ca0174bdfbc6586d2c6f570089eb5e54593111d879cb93fd97a0575233e3d5
4
+ data.tar.gz: 1c53782f71972337e7f6d4158cbfe261aa9a37a104b56e558dc950b3828cc3f4
5
5
  SHA512:
6
- metadata.gz: 3ad4f846af0ec602a4f8211f7f53f4358764e8aeed1e558dd46a3e8b8f70db66e02d53aa1242fb0715eb596c08c302d0d9cf23c499cf45246ae55f9f37e38c63
7
- data.tar.gz: f9b030d41c7a68b511254bcdeb153a0b2dfd047928e9b38f1ffba123423dbd908d10badf0d461934c5f8e5bfc9944f0260e80558fbd8b57f51d800ef9e986506
6
+ metadata.gz: 9a00ddc9c3750e5be40a987ea8ee988d8352cdafa08a8f5381b1792c72632a7683e3d003a691341672d5f8ef7cd75b0f830eba8c2e5806fdf83f6d47e7d19f9e
7
+ data.tar.gz: 240b4aea885e635c0c493237e2d7a67a1e3c22653b79217d598527641a1bb8586cfdf618c82d39874a98a76b41e2ea777ca1de5911510b782a5dc6129174b76c
@@ -0,0 +1 @@
1
+ * @procore-oss/procore-ospo @procore-oss/procore-rspec-profiling
@@ -0,0 +1,66 @@
1
+ name: 🐞 Bug
2
+ description: File a bug/issue
3
+ title: "[bug] <title>"
4
+ labels: [bug, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: checkboxes
14
+ attributes:
15
+ label: Is this a regression?
16
+ description: Did this behavior work before?
17
+ options:
18
+ - label: Yes, this used to work before
19
+ required: false
20
+ - type: textarea
21
+ attributes:
22
+ label: Current Behavior
23
+ description: A concise description of what you're experiencing.
24
+ validations:
25
+ required: false
26
+ - type: textarea
27
+ attributes:
28
+ label: Expected Behavior
29
+ description: A concise description of what you expected to happen.
30
+ validations:
31
+ required: false
32
+ - type: textarea
33
+ attributes:
34
+ label: Steps To Reproduce
35
+ description: Steps to reproduce the behavior.
36
+ placeholder: |
37
+ 1.
38
+ 2.
39
+ 3.
40
+ 4.
41
+ validations:
42
+ required: true
43
+ - type: textarea
44
+ attributes:
45
+ label: Environment
46
+ description: |
47
+ examples:
48
+ - **OS**: OSX 13.3.1
49
+ - **Browser Name and Version**: Chrome Version 112.0.5615.49 (Official Build) (arm64)
50
+ - **Ruby Version**: 3.0.0
51
+ value: |
52
+ - OS:
53
+ - Browser Name and version:
54
+ - Ruby Version:
55
+ render: markdown
56
+ validations:
57
+ required: true
58
+ - type: textarea
59
+ attributes:
60
+ label: Anything else?
61
+ description: |
62
+ Links? References? Anything that will give us more context about the issue you are encountering!
63
+
64
+ Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
65
+ validations:
66
+ required: false
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,18 @@
1
+ name: 📚 Documentation or README.md issue report
2
+ description: File a bug/issue for docs or README.md
3
+ title: "[bug] <title>"
4
+ labels: [docs, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Docs/README.md Part to update
16
+ description: A concise description of what you thing should be updated
17
+ validations:
18
+ required: true
@@ -0,0 +1,36 @@
1
+ name: 🚀🆕 Feature Request
2
+ description: Suggest an idea or possible new feature for this project
3
+ title: "[Feature Request] <title>"
4
+ labels: [feature, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Is your feature request related to a problem? Please describe
16
+ description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ attributes:
21
+ label: Describe the feature you'd like to see implemented
22
+ description: A clear and concise description of what you want to happen
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ attributes:
27
+ label: Describe alternatives you've considered
28
+ description: A clear and concise description of any alternative solutions or features you've considered
29
+ validations:
30
+ required: false
31
+ - type: textarea
32
+ attributes:
33
+ label: Additional context
34
+ description: Add any other context or additional information about the problem here
35
+ validations:
36
+ required: false
@@ -0,0 +1,18 @@
1
+ name: ❓ Question or Support Request
2
+ description: Questions and requests for support
3
+ title: "[Question/Support] <title>"
4
+ labels: [question, support, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Describe your question or ask for support
16
+ description: A concise description of what you would like support with
17
+ validations:
18
+ required: true
@@ -0,0 +1,17 @@
1
+ Checklist:
2
+
3
+ * [ ] I have updated the necessary documentation
4
+ * [ ] I have signed off all my commits as required by [DCO](https://github.com/procore-oss/rspec_profiling/blob/main/CONTRIBUTING.md)
5
+ * [ ] My build is green
6
+
7
+ <!--
8
+ Note on DCO:
9
+
10
+ If the DCO check fails, one or more of your commits are not signed off. Please click on the *Details* link next to the DCO action for instructions on how to resolve this.
11
+
12
+ TL;DR - You need to sign off your commits with `git commit -s` or `git commit --signoff` to indicate that you agree to the terms of the DCO.
13
+
14
+ Note on Versioning:
15
+
16
+ Maintainers will bump the version and do a release when they are ready to release (possibly multiple merged PRs). Please do not bump the version in your PRs.
17
+ -->
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: /
5
+ schedule:
6
+ interval: "weekly"
7
+ timezone: "America/Los_Angeles"
8
+ labels:
9
+ - "dependabot"
10
+ - "dependencies"
11
+ - "github-actions"
12
+ - package-ecosystem: "bundler"
13
+ directory: /
14
+ schedule:
15
+ interval: "weekly"
16
+ timezone: "America/Los_Angeles"
17
+ labels:
18
+ - "dependabot"
19
+ - "dependencies"
20
+ - "bundler"
@@ -0,0 +1,13 @@
1
+ name: 'Auto Author Assign'
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, reopened]
6
+
7
+ jobs:
8
+ assign-author:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: toshimaru/auto-author-assign@v2.1.0
12
+ with:
13
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -0,0 +1,43 @@
1
+ name: "Custom CodeQL"
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: [ "main" ]
7
+ pull_request:
8
+ branches: [ "main" ]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ analyze:
15
+ name: Analyze
16
+ runs-on: Ubuntu-latest
17
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
18
+ permissions:
19
+ actions: read
20
+ contents: read
21
+ security-events: write
22
+
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ language: [ 'ruby' ]
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+
32
+ - name: Initialize CodeQL
33
+ uses: github/codeql-action/init@v3
34
+ with:
35
+ languages: ${{ matrix.language }}
36
+
37
+ - name: Autobuild
38
+ uses: github/codeql-action/autobuild@v3
39
+
40
+ - name: Perform CodeQL Analysis
41
+ uses: github/codeql-action/analyze@v3
42
+ with:
43
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,40 @@
1
+ name: Release
2
+ on:
3
+ workflow_run:
4
+ workflows: [Test]
5
+ types: [completed]
6
+ branches: [main]
7
+ workflow_dispatch: # allow manual deployment through GitHub Action UI
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Version file changed
15
+ id: version-file-changed
16
+ uses: tj-actions/changed-files@v42
17
+ with:
18
+ files: lib/rspec_profiling/version.rb
19
+ - name: Set up Ruby
20
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 3.2
24
+ bundler-cache: true
25
+ - name: Installing dependencies
26
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
27
+ run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
28
+ - name: Build gem file
29
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
30
+ run: bundle exec rake build
31
+ - uses: fac/ruby-gem-setup-credentials-action@v2
32
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
33
+ with:
34
+ user: ""
35
+ key: rubygems
36
+ token: ${{secrets.RUBY_GEMS_API_KEY}}
37
+ - uses: fac/ruby-gem-push-action@v2
38
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
39
+ with:
40
+ key: rubygems
@@ -0,0 +1,38 @@
1
+ ## Reference: https://github.com/actions/stale
2
+ name: Mark stale issues and pull requests
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ stale:
12
+ permissions:
13
+ issues: write # for actions/stale to close stale issues
14
+ pull-requests: write # for actions/stale to close stale PRs
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/stale@v9
18
+ with:
19
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
20
+ # Number of days of inactivity before an issue becomes stale
21
+ days-before-stale: 60
22
+ # Number of days of inactivity before a stale issue is closed
23
+ days-before-close: 7
24
+ # Issues with these labels will never be considered stale
25
+ exempt-issue-labels: "on-hold,pinned,security"
26
+ exempt-pr-labels: "on-hold,pinned,security"
27
+ # Comment to post when marking an issue as stale.
28
+ stale-issue-message: >
29
+ This issue has been automatically marked as stale because it has not had
30
+ recent activity. It will be closed if no further activity occurs. Thank you
31
+ for your contributions.
32
+ stale-pr-message: >
33
+ This pull request has been automatically marked as stale because it has not had
34
+ recent activity. It will be closed if no further activity occurs. Thank you
35
+ for your contributions.
36
+ # Label to use when marking an issue as stale
37
+ stale-issue-label: 'no-issue-activity'
38
+ stale-pr-label: 'no-pr-activity'
@@ -0,0 +1,54 @@
1
+ name: Test
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ permissions:
8
+ contents: read
9
+ jobs:
10
+ test:
11
+ env:
12
+ ENVIRONMENT: test
13
+ PGDATABASE: rspec_profiling_test
14
+ PGHOST: localhost
15
+ PGPASSWORD: mypassword
16
+ PGUSER: myuser
17
+ SPEC_GEMFILE: spec/Gemfile
18
+ strategy:
19
+ matrix:
20
+ ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
21
+ postgres: ['16-bookworm', '15-bookworm', '14-bookworm', '13-bookworm', '12-bookworm']
22
+ name: Ruby ${{ matrix.ruby }} - PostgreSQL ${{ matrix.postgres }}
23
+ # https://docs.github.com/en/actions/learn-github-actions/expressions#example
24
+ runs-on: ${{ matrix.ruby == '2.7' && 'ubuntu-20.04' || 'ubuntu-latest' }}
25
+ services:
26
+ postgres:
27
+ image: postgres:${{ matrix.postgres }}
28
+ env:
29
+ POSTGRES_HOST: ${{ env.PGHOST }}
30
+ POSTGRES_DB: ${{ env.PGDATABASE}}
31
+ POSTGRES_HOST_AUTH_METHOD: trust
32
+ POSTGRES_USER: ${{ env.PGUSER }}
33
+ options: >-
34
+ --health-cmd pg_isready
35
+ --health-interval 10s
36
+ --health-timeout 5s
37
+ --health-retries 5
38
+ ports:
39
+ - 5432:5432
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - name: Set up Ruby ${{ matrix.ruby }}
43
+ uses: ruby/setup-ruby@v1
44
+ with:
45
+ ruby-version: ${{ matrix.ruby }}
46
+ bundler-cache: true
47
+ - name: Installing dependencies
48
+ run: bundle install --gemfile ${{ env.SPEC_GEMFILE }} && cd spec/dummy && bundle install
49
+ - name: Setup Database in Dummy Rails App
50
+ run: cd spec/dummy && bundle exec rake db:create db:migrate --trace RAILS_ENV=${{ env.ENVIRONMENT }}
51
+ - name: Initialize rspec_profiling in Dummy Rails App
52
+ run: cd spec/dummy && bundle exec rake rspec_profiling:install RAILS_ENV=${{ env.ENVIRONMENT }}
53
+ - name: Run specs
54
+ run: bundle exec --gemfile ${{ env.SPEC_GEMFILE }} rspec
data/.gitignore CHANGED
@@ -2,6 +2,8 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
+ .env
6
+ .ruby-gemset
5
7
  .yardoc
6
8
  Gemfile.lock
7
9
  InstalledFiles
@@ -11,6 +13,7 @@ doc/
11
13
  lib/bundler/man
12
14
  pkg
13
15
  rdoc
16
+ rspec_profiling
14
17
  spec/reports
15
18
  test/tmp
16
19
  test/version_tmp
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.1
1
+ ruby-3.3
@@ -0,0 +1,130 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Spam or other deceptive practices that take advantage of the community
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ <opensource@procore.com>.
65
+ All complaints will be reviewed and investigated promptly and fairly by
66
+ the Procore Open Source Program Office (OSPO)
67
+
68
+ All community leaders are obligated to respect the privacy and security of the
69
+ reporter of any incident.
70
+
71
+ ## Enforcement Guidelines
72
+
73
+ Community leaders will follow these Community Impact Guidelines in determining
74
+ the consequences for any action they deem in violation of this Code of Conduct:
75
+
76
+ ### 1. Correction
77
+
78
+ **Community Impact**: Use of inappropriate language or other behavior deemed
79
+ unprofessional or unwelcome in the community.
80
+
81
+ **Consequence**: A private, written warning from community leaders, providing
82
+ clarity around the nature of the violation and an explanation of why the
83
+ behavior was inappropriate. A public apology may be requested.
84
+
85
+ ### 2. Warning
86
+
87
+ **Community Impact**: A violation through a single incident or series
88
+ of actions.
89
+
90
+ **Consequence**: A warning with consequences for continued behavior. No
91
+ interaction with the people involved, including unsolicited interaction with
92
+ those enforcing the Code of Conduct, for a specified period of time. This
93
+ includes avoiding interactions in community spaces as well as external channels
94
+ like social media. Violating these terms may lead to a temporary or
95
+ permanent ban.
96
+
97
+ ### 3. Temporary Ban
98
+
99
+ **Community Impact**: A serious violation of community standards, including
100
+ sustained inappropriate behavior.
101
+
102
+ **Consequence**: A temporary ban from any sort of interaction or public
103
+ communication with the community for a specified period of time. No public or
104
+ private interaction with the people involved, including unsolicited interaction
105
+ with those enforcing the Code of Conduct, is allowed during this period.
106
+ Violating these terms may lead to a permanent ban.
107
+
108
+ ### 4. Permanent Ban
109
+
110
+ **Community Impact**: Demonstrating a pattern of violation of community
111
+ standards, including sustained inappropriate behavior, harassment of an
112
+ individual, or aggression toward or disparagement of classes of individuals.
113
+
114
+ **Consequence**: A permanent ban from any sort of public interaction within
115
+ the community.
116
+
117
+ ## Attribution
118
+
119
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
120
+ version 2.0, available at
121
+ <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
122
+
123
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
124
+ enforcement ladder](https://github.com/mozilla/diversity).
125
+
126
+ [homepage]: https://www.contributor-covenant.org
127
+
128
+ For answers to common questions about this code of conduct, see the FAQ at
129
+ <https://www.contributor-covenant.org/faq>. Translations are available at
130
+ <https://www.contributor-covenant.org/translations>.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,37 @@
1
+ # Contributing to Procore Projects
2
+
3
+ This document explains the common procedures expected by contributors while submitting code to Procore open source projects.
4
+
5
+ ## Code of Conduct
6
+
7
+ Please read and abide by the [Code of Conduct](CODE_OF_CONDUCT.md)
8
+
9
+ ## General workflow
10
+
11
+ Once a GitHub issue is accepted and assigned to you, please follow general workflow in order to submit your contribution:
12
+
13
+ 1. Fork the target repository under your GitHub username.
14
+ 2. Create a branch in your forked repository for the changes you are about to make.
15
+ 3. Commit your changes in the branch you created in step 2. All commits need to be signed-off. Check the [legal](#legal) section bellow for more details.
16
+ 4. Push your commits to your remote fork.
17
+ 5. Create a Pull Request from your remote fork pointing to the HEAD branch (usually `main` branch) of the target repository.
18
+ 6. Check the GitHub build and ensure that all checks are green.
19
+
20
+ ## Legal
21
+
22
+ Procore projects use Developer Certificate of Origin ([DCO](https://GitHub.com/apps/dco/)).
23
+
24
+ Please sign-off your contributions by doing ONE of the following:
25
+
26
+ * Use `git commit -s ...` with each commit to add the sign-off or
27
+ * Manually add a `Signed-off-by: Your Name <your.email@example.com>` to each commit message.
28
+
29
+ The email address must match your primary GitHub email. You do NOT need cryptographic (e.g. gpg) signing.
30
+
31
+ * Use `git commit -s --amend ...` to add a sign-off to the latest commit, if you forgot.
32
+
33
+ *Note*: Some projects will provide specific configuration to ensure all commits are signed-off. Please check the project's documentation for more details.
34
+
35
+ ## Tests
36
+
37
+ Make sure your changes are properly covered by automated tests. We aim to build an efficient test suite that is low cost to maintain and bring value to project. Prefer writing unit-tests over heavy end-to-end (e2e) tests. However, sometimes e2e tests are necessary. If you aren't sure, ask one of the maintainers about the requirements for your pull-request.
data/EMERITUS.md ADDED
@@ -0,0 +1,3 @@
1
+ This repo is a fork of <https://github.com/foraker/rspec_profiling>.
2
+
3
+ [Former contributors](https://github.com/foraker/rspec_profiling/graphs/contributors)
@@ -1,4 +1,5 @@
1
- Copyright (c) 2014 Ben Eddy
1
+ Copyright (c) 2014-2024 Ben Eddy
2
+ Copyright (c) 2024 Procore Technologies, Inc.
2
3
 
3
4
  MIT License
4
5
 
data/Makefile ADDED
@@ -0,0 +1,60 @@
1
+ # -e says exit immediately when a command fails
2
+ # -o sets pipefail, meaning if it exits with a failing command, the exit code should be of the failing command
3
+ # -u fails a bash script immediately if a variable is unset
4
+ ENVIRONMENT := test
5
+ PGHOST := localhost
6
+ PGPORT := 5432
7
+ PGUSER := myuser
8
+ PGPASSWORD := mypassword
9
+ SHELL = /bin/bash -eu -o pipefail
10
+
11
+ define is_installed
12
+ if ! command -v $(1) &> /dev/null; \
13
+ then \
14
+ echo "$(1) not installed, please install it. 'brew install $(1)'"; \
15
+ exit; \
16
+ fi;
17
+ endef
18
+
19
+ .PHONY : help
20
+ help : # Display help
21
+ @awk -F ':|##' \
22
+ '/^[^\t].+?:.*?##/ {\
23
+ printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \
24
+ }' $(MAKEFILE_LIST)
25
+
26
+ .PHONY : ruby_installed
27
+ ruby_installed: ## check if ruby is installed
28
+ @$(call is_installed,ruby)
29
+
30
+ .PHONY : bundle
31
+ bundle: ruby_installed ## install gems
32
+ @bundle install --gemfile spec/Gemfile && cd spec/dummy && bundle install
33
+
34
+ .PHONY : setup_db
35
+ setup_db: ruby_installed postgres ## setup database
36
+ @echo "setting up database"
37
+ @cd spec/dummy && bundle exec rake db:create db:migrate --trace RAILS_ENV=${ENVIRONMENT}
38
+
39
+ .PHONY : initialize_profiling
40
+ initialize_profiling: ruby_installed ## initialize rspec_profiling
41
+ @echo "initializing rspec_profiling"
42
+ @cd spec/dummy && bundle exec rake rspec_profiling:install RAILS_ENV=${ENVIRONMENT}
43
+
44
+ .PHONY : spec
45
+ spec : bundle setup_db initialize_profiling ## run specs
46
+ @echo "running specs"
47
+ @bundle exec --gemfile=spec/dummy/Gemfile rspec
48
+
49
+ .PHONY : test
50
+ test: spec ## run specs
51
+ @echo "running specs"
52
+
53
+ .PHONY : docker_installed
54
+ docker_installed: ## check if docker and docker-compose are installed
55
+ @$(call is_installed,docker)
56
+ @$(call is_installed,docker-compose)
57
+
58
+ .PHONY : postgres
59
+ postgres: docker_installed ## start postgres in docker container
60
+ @docker-compose up -d || true