flutter 0.1.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.overcommit.yml +8 -0
- data/.rubocop.yml +10 -0
- data/CHANGELOG.md +6 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +35 -0
- data/Guardfile +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +134 -0
- data/Rakefile +24 -0
- data/TODO.md +30 -0
- data/integration_tests/minitest/grape_app/.gitignore +67 -0
- data/integration_tests/minitest/grape_app/.ruby-version +1 -0
- data/integration_tests/minitest/grape_app/Gemfile +17 -0
- data/integration_tests/minitest/grape_app/Gemfile.lock +89 -0
- data/integration_tests/minitest/grape_app/README.md +2 -0
- data/integration_tests/minitest/grape_app/Rakefile +9 -0
- data/integration_tests/minitest/grape_app/api/api.rb +34 -0
- data/integration_tests/minitest/grape_app/api/routes/api_helpers.rb +12 -0
- data/integration_tests/minitest/grape_app/api/routes/change_request/api.rb +69 -0
- data/integration_tests/minitest/grape_app/api/routes/change_request/response_entity.rb +18 -0
- data/integration_tests/minitest/grape_app/api/routes/event/api.rb +121 -0
- data/integration_tests/minitest/grape_app/api/routes/event/response_entity.rb +41 -0
- data/integration_tests/minitest/grape_app/api/routes/project/api.rb +59 -0
- data/integration_tests/minitest/grape_app/api/routes/project/response_entity.rb +13 -0
- data/integration_tests/minitest/grape_app/api/routes/property/api.rb +78 -0
- data/integration_tests/minitest/grape_app/api/routes/property/response_entity.rb +31 -0
- data/integration_tests/minitest/grape_app/api/routes/trackable_object/api.rb +64 -0
- data/integration_tests/minitest/grape_app/api/routes/trackable_object/response_entity.rb +24 -0
- data/integration_tests/minitest/grape_app/api/routes/tracking_spec/api.rb +88 -0
- data/integration_tests/minitest/grape_app/api/routes/tracking_spec/response_entity.rb +17 -0
- data/integration_tests/minitest/grape_app/api/routes/tracking_spec/spec_response.rb +19 -0
- data/integration_tests/minitest/grape_app/api/routes/user/api.rb +22 -0
- data/integration_tests/minitest/grape_app/api/routes/user/response_entity.rb +12 -0
- data/integration_tests/minitest/grape_app/app/app.rb +30 -0
- data/integration_tests/minitest/grape_app/app/change_request/endpoint.rb +24 -0
- data/integration_tests/minitest/grape_app/app/change_request/generate_system_changes.rb +25 -0
- data/integration_tests/minitest/grape_app/app/change_request/service.rb +79 -0
- data/integration_tests/minitest/grape_app/app/event/endpoint.rb +78 -0
- data/integration_tests/minitest/grape_app/app/event/service.rb +68 -0
- data/integration_tests/minitest/grape_app/app/event/validator.rb +108 -0
- data/integration_tests/minitest/grape_app/app/project/endpoint.rb +24 -0
- data/integration_tests/minitest/grape_app/app/project/service.rb +42 -0
- data/integration_tests/minitest/grape_app/app/property/endpoint.rb +39 -0
- data/integration_tests/minitest/grape_app/app/property/service.rb +56 -0
- data/integration_tests/minitest/grape_app/app/trackable_object/endpoint.rb +38 -0
- data/integration_tests/minitest/grape_app/app/trackable_object/service.rb +49 -0
- data/integration_tests/minitest/grape_app/app/trackable_object/validator.rb +40 -0
- data/integration_tests/minitest/grape_app/app/tracking_spec/endpoint.rb +58 -0
- data/integration_tests/minitest/grape_app/app/tracking_spec/expand_tracking_spec_events.rb +91 -0
- data/integration_tests/minitest/grape_app/app/tracking_spec/service.rb +51 -0
- data/integration_tests/minitest/grape_app/app/tracking_spec/validator.rb +61 -0
- data/integration_tests/minitest/grape_app/app/utils/errors/api_exceptions.rb +10 -0
- data/integration_tests/minitest/grape_app/app/utils/errors/service_exceptions.rb +12 -0
- data/integration_tests/minitest/grape_app/app/versioned_entity/entity.rb +110 -0
- data/integration_tests/minitest/grape_app/app/versioned_entity/service.rb +47 -0
- data/integration_tests/minitest/grape_app/app/versioned_entity/validator.rb +61 -0
- data/integration_tests/minitest/grape_app/app/versioned_entity_snapshot/entity.rb +32 -0
- data/integration_tests/minitest/grape_app/config/boot.rb +9 -0
- data/integration_tests/minitest/grape_app/config.ru +3 -0
- data/integration_tests/minitest/grape_app/db/proto/change_request.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/common/doc.rb +86 -0
- data/integration_tests/minitest/grape_app/db/proto/event.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/event_snapshot.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/project.rb +21 -0
- data/integration_tests/minitest/grape_app/db/proto/property.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/property_snapshot.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/trackable_object.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/trackable_object_snapshot.rb +10 -0
- data/integration_tests/minitest/grape_app/db/proto/tracking_spec.rb +10 -0
- data/integration_tests/minitest/grape_app/test/api/functional/event_test.rb +186 -0
- data/integration_tests/minitest/grape_app/test/api/functional/property_test.rb +197 -0
- data/integration_tests/minitest/grape_app/test/api/functional/trackable_object_test.rb +134 -0
- data/integration_tests/minitest/grape_app/test/api/functional/tracking_spec_test.rb +56 -0
- data/integration_tests/minitest/grape_app/test/api/functional/user_test.rb +24 -0
- data/integration_tests/minitest/grape_app/test/api/functional/versioned_entity_helper.rb +157 -0
- data/integration_tests/minitest/grape_app/test/fixtures/change_requests.rb +83 -0
- data/integration_tests/minitest/grape_app/test/fixtures/event_snapshots.rb +105 -0
- data/integration_tests/minitest/grape_app/test/fixtures/events.rb +58 -0
- data/integration_tests/minitest/grape_app/test/fixtures/properties.rb +66 -0
- data/integration_tests/minitest/grape_app/test/fixtures/property_snapshots.rb +124 -0
- data/integration_tests/minitest/grape_app/test/fixtures/sample_tracking_spec.json +125 -0
- data/integration_tests/minitest/grape_app/test/fixtures/trackable_objects.rb +58 -0
- data/integration_tests/minitest/grape_app/test/fixtures/trackable_objects_snapshots.rb +61 -0
- data/integration_tests/minitest/grape_app/test/fixtures/tracking_specs.rb +22 -0
- data/integration_tests/minitest/grape_app/test/test_helper.rb +15 -0
- data/lib/flutter/config.rb +24 -0
- data/lib/flutter/minitest.rb +83 -0
- data/lib/flutter/parser.rb +82 -0
- data/lib/flutter/persistence.rb +152 -0
- data/lib/flutter/rspec.rb +66 -0
- data/lib/flutter/tracker.rb +133 -0
- data/lib/flutter/version.rb +5 -0
- data/lib/flutter.rb +12 -0
- data/lib/minitest/flutter_plugin.rb +16 -0
- data/sig/flutter.rbs +4 -0
- metadata +187 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c941483caa54c2444a2cfb3f264f9cea9cf79dbbeaac3e70803f83929d5ca542
|
4
|
+
data.tar.gz: 942bf3843ba7de39bd80c32b69f045126cc08a8b1a3a7b7d139d992a2642438a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a2a7862c51c5ecc07bc8ac6a16f99ab5e324a76a8905eab1382369c3e8f0230b1e062e774ad7934f526351c630ad4428478b66759ca68b9d5037d050df07b521
|
7
|
+
data.tar.gz: 43ea7ed0cbfcbbc354f1a1d7816d4bae213b73acdf9bb9585eeafbab545396f45d7eeb6adaa9aa8f8c085fcb7717f15c579d2f0a60804aed356df2e244c64ab9
|
data/.overcommit.yml
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ali@indydevs.org. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
gem "rake", "~> 13.0"
|
8
|
+
|
9
|
+
group :test, :development do
|
10
|
+
gem "pry", "~> 0.14.1"
|
11
|
+
gem "overcommit", "~> 0.59.1"
|
12
|
+
gem "gem-release", "~> 2.2"
|
13
|
+
gem "guard", "~> 2.18"
|
14
|
+
gem "rubocop", "~> 1.21"
|
15
|
+
gem "rubocop-shopify", require: false
|
16
|
+
gem "rubocop-minitest", "~> 0.22.1"
|
17
|
+
gem "rubocop-rspec", "~> 2.13"
|
18
|
+
gem "rubocop-rake", "~> 0.6.0"
|
19
|
+
# For integration test app
|
20
|
+
gem "dotenv"
|
21
|
+
gem "grape"
|
22
|
+
gem "grape-entity"
|
23
|
+
gem "grape-swagger"
|
24
|
+
gem "rack-test", require: "rack/test"
|
25
|
+
end
|
26
|
+
|
27
|
+
group :test do
|
28
|
+
gem "guard-minitest", "~> 2.4"
|
29
|
+
gem "guard-rspec", "~> 4.7"
|
30
|
+
gem "minitest", "~> 5.0"
|
31
|
+
gem "rspec", "~> 3.11"
|
32
|
+
gem "simplecov", "~> 0.21.2", require: false
|
33
|
+
gem "simplecov-console", "~> 0.9.1"
|
34
|
+
gem "simplecov-cobertura", "~> 2.1"
|
35
|
+
end
|
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Ali-Akber Saifee
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
# Flutter: Intelligent test selection based on incremental code changes
|
2
|
+
|
3
|
+
[![CI](https://github.com/indydevs/flutter/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/indydevs/flutter/actions/workflows/main.yml)
|
4
|
+
[![codecov](https://codecov.io/github/indydevs/flutter/branch/main/graph/badge.svg?token=XANF37D9C1)](https://codecov.io/github/indydevs/flutter)
|
5
|
+
[![Gem](https://img.shields.io/gem/v/flutter)](https://rubygems.org/gems/flutter)
|
6
|
+
|
7
|
+
```
|
8
|
+
__ __
|
9
|
+
( \,/ )
|
10
|
+
\_ | _/
|
11
|
+
(_/ \_)
|
12
|
+
|
13
|
+
```
|
14
|
+
Flutter plugs in to your [RSpec](https://rspec.info/) or [Minitest](https://github.com/minitest/minitest) test suites and helps you run only the tests that exercise the
|
15
|
+
code you have changed since the last run.
|
16
|
+
|
17
|
+
It can be used in local development as a live incremental test runner in
|
18
|
+
combination with [Guard](https://github.com/guard/guard) (See examples for [minitest](#with-guard) and [rspec](#with-guard-1) respectively)
|
19
|
+
or in continuous integration environments to only run the subset of tests affected by a pull request or changeset
|
20
|
+
(See [CI Recipes](#configuring-flutter-in-continuous-integration)).
|
21
|
+
|
22
|
+
## How?
|
23
|
+
Flutter tracks each method call within the context of each test case in your test suite and persists this mapping along with
|
24
|
+
a signature for all the methods that were exercised. On subsequent runs Flutter intercepts test enumeration and skips any test if
|
25
|
+
all the following conditions are true:
|
26
|
+
|
27
|
+
- The test was seen before
|
28
|
+
- The source of the test has not changed
|
29
|
+
- All the methods exercised in the last recorded run have no changes in their source
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
### Minitest
|
34
|
+
|
35
|
+
- Add the gem as a dependency
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
gem "flutter"
|
39
|
+
```
|
40
|
+
- Include it in your `test_helper.rb`:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'flutter'
|
44
|
+
```
|
45
|
+
- Enable & configure it in your `test_helper.rb`:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
Flutter.configure do |config|
|
49
|
+
config.enabled = true
|
50
|
+
# Paths to consider when tracking test -> source mappings. Default: Dir.pwd/*
|
51
|
+
config.sources = ["./app/*", "./test/*"]
|
52
|
+
# Paths to ignore for tracking test -> source. Default: ./vendor
|
53
|
+
config.exclusions = ["./vendor/*"]
|
54
|
+
# Storage type. Default: Flutter::Persistence::Marshal
|
55
|
+
config.storage_class = Flutter::Persistence::Marshal
|
56
|
+
# Where to store the state. Default: ./.flutter
|
57
|
+
config.storage_options = {path: "./.flutter"}
|
58
|
+
# Whether to reset the stored state before the test run. Default: false
|
59
|
+
config.reset_storage = false
|
60
|
+
end
|
61
|
+
```
|
62
|
+
|
63
|
+
#### With guard
|
64
|
+
Add the following to your `Guardfile`:
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
guard :minitest, test_folders: ["test"] do
|
68
|
+
watch(%r{^{test,lib}/(.*/)?([^/]+)\.rb$}) { "test" }
|
69
|
+
end
|
70
|
+
```
|
71
|
+
|
72
|
+
### RSpec
|
73
|
+
|
74
|
+
- Add the gem as a dependency:
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
gem "flutter"
|
78
|
+
```
|
79
|
+
- Include the plugin in your `spec_helper.rb`:
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
require 'flutter'
|
83
|
+
```
|
84
|
+
- Enable & configure it in your `spec_helper.rb`:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
Flutter.configure do |config|
|
88
|
+
config.enabled = true
|
89
|
+
# Paths to consider when tracking test -> source mappings. Default: Dir.pwd/*
|
90
|
+
config.sources = ["./app/*", "./test/*"]
|
91
|
+
# Paths to ignore for tracking test -> source. Default: ./vendor
|
92
|
+
config.exclusions = ["./vendor/*"]
|
93
|
+
# Storage type. Default: Flutter::Persistence::Marshal
|
94
|
+
config.storage_class = Flutter::Persistence::Marshal
|
95
|
+
# Where to store the state. Default: ./.flutter
|
96
|
+
config.storage_options = {path: "./.flutter"}
|
97
|
+
# Whether to reset the stored state before the test run. Default: false
|
98
|
+
config.reset_storage = false
|
99
|
+
end
|
100
|
+
```
|
101
|
+
#### With guard
|
102
|
+
Using the same configuration as above add the following to your `Guardfile`:
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
guard :rspec, cmd: "rspec" do
|
106
|
+
watch(%r{^{spec,lib}/(.*/)?([^/]+)\.rb$}) { "spec" }
|
107
|
+
end
|
108
|
+
```
|
109
|
+
## Configuring flutter in continuous integration
|
110
|
+
**TODO**
|
111
|
+
|
112
|
+
## Related work
|
113
|
+
|
114
|
+
Flutter is heavily inspired by [testmon](https://github.com/tarpas/pytest-testmon)
|
115
|
+
|
116
|
+
## Development
|
117
|
+
|
118
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
119
|
+
|
120
|
+
This project uses [overcommit](https://github.com/sds/overcommit) to enforce standards. Enable the precommit hooks in your local checkout by running: `overcommit --sign`
|
121
|
+
|
122
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
123
|
+
|
124
|
+
## Contributing
|
125
|
+
|
126
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/indydevs/flutter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/indydevs/flutter/blob/main/CODE_OF_CONDUCT.md).
|
127
|
+
|
128
|
+
## License
|
129
|
+
|
130
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
131
|
+
|
132
|
+
## Code of Conduct
|
133
|
+
|
134
|
+
Everyone interacting in the Flutter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/indydevs/flutter/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:unit) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/test_*.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
Rake::TestTask.new(:integration) do |t|
|
13
|
+
t.test_files = FileList["integration_tests/minitest/grape_app/test/**/*_test.rb"]
|
14
|
+
end
|
15
|
+
|
16
|
+
require "rubocop/rake_task"
|
17
|
+
|
18
|
+
RuboCop::RakeTask.new
|
19
|
+
|
20
|
+
require "rspec/core/rake_task"
|
21
|
+
RSpec::Core::RakeTask.new(:spec)
|
22
|
+
|
23
|
+
task test: [:unit, :spec]
|
24
|
+
task default: [:test, :spec, "rubocop:autocorrect_all"]
|
data/TODO.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# TODO
|
2
|
+
|
3
|
+
## Functionality
|
4
|
+
- [x] Changes to tests themselves do not re-trigger execution
|
5
|
+
- [x] Minispec
|
6
|
+
- [x] RSpec
|
7
|
+
- [ ] Changes in blocks or dynamically added functions based on blocks do not re-trigger execution
|
8
|
+
|
9
|
+
## Code quality
|
10
|
+
- [ ] Separate public/private API
|
11
|
+
- [ ] Add rdoc / yard documentation
|
12
|
+
|
13
|
+
## Testing
|
14
|
+
- [x] Improve test coverage
|
15
|
+
- [x] Add integration tests
|
16
|
+
- [ ] Test against large / complex codebases
|
17
|
+
- [ ] Sidekiq (Minitest)
|
18
|
+
- [ ] Discourse (RSpec)
|
19
|
+
## Performance
|
20
|
+
- [ ] Ensure only bare minimum signature calculation occurs
|
21
|
+
- [ ] Optimize inner loop of tracking test case -> method calls
|
22
|
+
- [ ] Evaluate alternate storage options (sqlite, leveldb..?)
|
23
|
+
- [x] Marshal storage
|
24
|
+
- [ ] Evaluate using external hints for changes (for example when using with VCS)
|
25
|
+
|
26
|
+
## Usability
|
27
|
+
- [x] Quick start guide
|
28
|
+
- [x] Recipes for guard
|
29
|
+
- [ ] Recipes for CI
|
30
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
# Ignore Byebug command history file.
|
17
|
+
.byebug_history
|
18
|
+
|
19
|
+
## Specific to RubyMotion:
|
20
|
+
.dat*
|
21
|
+
.repl_history
|
22
|
+
build/
|
23
|
+
*.bridgesupport
|
24
|
+
build-iPhoneOS/
|
25
|
+
build-iPhoneSimulator/
|
26
|
+
|
27
|
+
## Specific to RubyMotion (use of CocoaPods):
|
28
|
+
#
|
29
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
+
#
|
33
|
+
# vendor/Pods/
|
34
|
+
|
35
|
+
## Documentation cache and generated files:
|
36
|
+
/.yardoc/
|
37
|
+
/_yardoc/
|
38
|
+
/doc/
|
39
|
+
/rdoc/
|
40
|
+
|
41
|
+
## Environment normalization:
|
42
|
+
/.bundle/
|
43
|
+
/vendor/bundle
|
44
|
+
/lib/bundler/man/
|
45
|
+
|
46
|
+
# for a library or gem, you might want to ignore these files since the code is
|
47
|
+
# intended to run in multiple environments; otherwise, check them in:
|
48
|
+
# Gemfile.lock
|
49
|
+
# .ruby-version
|
50
|
+
# .ruby-gemset
|
51
|
+
|
52
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
+
.rvmrc
|
54
|
+
|
55
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
56
|
+
# .rubocop-https?--*
|
57
|
+
|
58
|
+
### VisualStudioCode ###
|
59
|
+
.vscode/
|
60
|
+
|
61
|
+
### VisualStudioCode Patch ###
|
62
|
+
# Ignore all local history of files
|
63
|
+
.history
|
64
|
+
|
65
|
+
.idea/
|
66
|
+
|
67
|
+
# End of https://www.gitignore.io/api/visualstudiocode
|
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
source 'https://rubygems.org'
|
3
|
+
gem 'dotenv'
|
4
|
+
# api definitions
|
5
|
+
gem 'grape'
|
6
|
+
gem 'grape-entity'
|
7
|
+
gem 'grape-swagger'
|
8
|
+
# web server
|
9
|
+
gem 'puma'
|
10
|
+
# task runner for ruby
|
11
|
+
gem 'rake'
|
12
|
+
gem 'flutter', path: '../../../'
|
13
|
+
|
14
|
+
group :development, :test do
|
15
|
+
gem 'minitest' #, require: false
|
16
|
+
gem 'rack-test', require: 'rack/test'
|
17
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../../..
|
3
|
+
specs:
|
4
|
+
flutter (0.1.0)
|
5
|
+
deep_merge
|
6
|
+
dry-configurable
|
7
|
+
parser
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activesupport (7.0.4)
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
minitest (>= 5.1)
|
16
|
+
tzinfo (~> 2.0)
|
17
|
+
ast (2.4.2)
|
18
|
+
builder (3.2.4)
|
19
|
+
concurrent-ruby (1.1.10)
|
20
|
+
deep_merge (1.2.2)
|
21
|
+
dotenv (2.8.1)
|
22
|
+
dry-configurable (0.15.0)
|
23
|
+
concurrent-ruby (~> 1.0)
|
24
|
+
dry-core (~> 0.6)
|
25
|
+
dry-container (0.11.0)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-core (0.8.1)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
dry-inflector (0.3.0)
|
30
|
+
dry-logic (1.2.0)
|
31
|
+
concurrent-ruby (~> 1.0)
|
32
|
+
dry-core (~> 0.5, >= 0.5)
|
33
|
+
dry-types (1.5.1)
|
34
|
+
concurrent-ruby (~> 1.0)
|
35
|
+
dry-container (~> 0.3)
|
36
|
+
dry-core (~> 0.5, >= 0.5)
|
37
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
38
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
39
|
+
grape (1.6.2)
|
40
|
+
activesupport
|
41
|
+
builder
|
42
|
+
dry-types (>= 1.1)
|
43
|
+
mustermann-grape (~> 1.0.0)
|
44
|
+
rack (>= 1.3.0)
|
45
|
+
rack-accept
|
46
|
+
grape-entity (0.10.2)
|
47
|
+
activesupport (>= 3.0.0)
|
48
|
+
multi_json (>= 1.3.2)
|
49
|
+
grape-swagger (1.5.0)
|
50
|
+
grape (~> 1.3)
|
51
|
+
i18n (1.12.0)
|
52
|
+
concurrent-ruby (~> 1.0)
|
53
|
+
minitest (5.16.3)
|
54
|
+
multi_json (1.15.0)
|
55
|
+
mustermann (3.0.0)
|
56
|
+
ruby2_keywords (~> 0.0.1)
|
57
|
+
mustermann-grape (1.0.2)
|
58
|
+
mustermann (>= 1.0.0)
|
59
|
+
nio4r (2.5.8)
|
60
|
+
parser (3.1.2.1)
|
61
|
+
ast (~> 2.4.1)
|
62
|
+
puma (5.6.5)
|
63
|
+
nio4r (~> 2.0)
|
64
|
+
rack (3.0.0)
|
65
|
+
rack-accept (0.4.5)
|
66
|
+
rack (>= 0.4)
|
67
|
+
rack-test (2.0.2)
|
68
|
+
rack (>= 1.3)
|
69
|
+
rake (13.0.6)
|
70
|
+
ruby2_keywords (0.0.5)
|
71
|
+
tzinfo (2.0.5)
|
72
|
+
concurrent-ruby (~> 1.0)
|
73
|
+
|
74
|
+
PLATFORMS
|
75
|
+
ruby
|
76
|
+
|
77
|
+
DEPENDENCIES
|
78
|
+
dotenv
|
79
|
+
flutter!
|
80
|
+
grape
|
81
|
+
grape-entity
|
82
|
+
grape-swagger
|
83
|
+
minitest
|
84
|
+
puma
|
85
|
+
rack-test
|
86
|
+
rake
|
87
|
+
|
88
|
+
BUNDLED WITH
|
89
|
+
2.1.4
|
@@ -0,0 +1,9 @@
|
|
1
|
+
task default: %w[test]
|
2
|
+
|
3
|
+
task :test do
|
4
|
+
ruby 'api/test/functional/user_test.rb'
|
5
|
+
ruby 'api/test/functional/event_test.rb'
|
6
|
+
ruby 'api/test/functional/trackable_object_test.rb'
|
7
|
+
ruby 'api/test/functional/property_test.rb'
|
8
|
+
ruby 'api/test/functional/tracking_spec_test.rb'
|
9
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative './routes/trackable_object/api'
|
2
|
+
require_relative './routes/property/api'
|
3
|
+
require_relative './routes/event/api'
|
4
|
+
require_relative './routes/project/api'
|
5
|
+
require_relative './routes/change_request/api'
|
6
|
+
require_relative './routes/tracking_spec/api'
|
7
|
+
require_relative './routes/user/api'
|
8
|
+
|
9
|
+
module Skee
|
10
|
+
module API
|
11
|
+
class API < Grape::API
|
12
|
+
version 'v1', using: :header, vendor: 'skee'
|
13
|
+
format :json
|
14
|
+
prefix :api
|
15
|
+
|
16
|
+
rescue_from Skee::App::Utils::Errors::ValidationError do |e|
|
17
|
+
error!(e, 400)
|
18
|
+
end
|
19
|
+
|
20
|
+
before do
|
21
|
+
header 'Access-Control-Allow-Origin', '*'
|
22
|
+
header 'Access-Control-Allow-Headers', 'content-type'
|
23
|
+
end
|
24
|
+
|
25
|
+
mount Skee::API::Routes::TrackableObject::API
|
26
|
+
mount Skee::API::Routes::Property::API
|
27
|
+
mount Skee::API::Routes::Event::API
|
28
|
+
mount Skee::API::Routes::Project::API
|
29
|
+
mount Skee::API::Routes::ChangeRequest::API
|
30
|
+
mount Skee::API::Routes::TrackingSpec::API
|
31
|
+
mount Skee::API::Routes::User::API
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|