ubicloud/spec/model
Jeremy Evans 45a66b2195 Support testing with frozen Database and models
This makes the testing more like the production environment.

This renames the previous frozen_{,p}spec rake task to
frozen_core_{,p}spec, and adds:

* frozen_db_model_{,p}spec for running the specs with just a frozen
  Database and models
* frozen_{,p}spec for running the specs with a frozen core, Database,
  and models (the most similar to the production environment, but
  the most skipped tests).

This adds rspec and turbo_tests lambdas to DRY up the related rake
task code. It sets RAKE_ENV explicitly for turbo_tests, instead
of relying on the Rakefile setting it implicitly due to how the
spec tasks is currently defined.

This adds a skip_if_frozen_models method to the specs, which does
nothing when running without frozen Database and models, but skips
the spec if running with frozen Database and models.  It then
adds a call to skip_if_frozen_models to all specs that try to mock
DB or the models (109 callsites, 124 specs).

To avoid pages of output of skipped specs, this uses the approach
recommended by the rspec maintainers to suppress skipped specs.
The approach is stored in a separate spec/supress_pending file
so it is usable by both the normal and parallel specs.

I tested this with the implicit_subquery commit
(0085befc4a), and the frozen model
tests fail with it, showing that this approach would have caught
that failure before the change was put into production.
2024-10-28 14:31:00 -07:00
..
ai Support running specs with frozen environment 2024-10-27 13:25:30 -07:00
dns_zone Rename PostgresResource server_name to name 2024-01-15 14:23:16 +03:00
github Delete all cache entries when repository delete 2024-07-18 15:12:27 +03:00
minio Add create_vm spec helper 2024-06-10 08:53:53 +03:00
postgres Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
api_key_spec.rb Introduce API keys 2024-10-01 15:36:57 +02:00
billing_info_spec.rb Introduce billing details 2023-08-11 11:33:06 +03:00
billing_record_spec.rb Introduce billing for inference endpoints 2024-10-16 13:56:06 +02:00
boot_image_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
firewall_rule_spec.rb Update firewall and firewall rules tests to include location 2024-07-31 14:26:54 +03:00
firewall_spec.rb Update firewall and firewall rules tests to include location 2024-07-31 14:26:54 +03:00
github_installation_spec.rb Change total_active_runner_cores to count cores 2024-07-05 12:25:01 +02:00
github_runner_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
hetzner_host_spec.rb Introduce Hetzner API support for IPv4 2023-06-19 13:12:05 +02:00
invoice_spec.rb Support running specs with frozen environment 2024-10-27 13:25:30 -07:00
ipsec_tunnel_spec.rb Remove refresh_mesh logic 2023-08-22 17:11:00 +02:00
load_balancer_spec.rb Add Load Balancer custom hostname support 2024-10-07 17:08:25 +02:00
nic_spec.rb Vm, PrivateSubnet, Nic tests 2023-07-26 17:15:59 +03:00
page_spec.rb Add ubid and debug link to Pagerduty incidents 2023-11-02 16:40:48 +03:00
payment_method_spec.rb Introduce billing details 2023-08-11 11:33:06 +03:00
pci_device_spec.rb Introduce PciDevice model 2024-05-07 16:10:05 +02:00
private_subnet_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
project_quota_spec.rb Add tests to ensure uniqueness of default quotas 2024-07-26 11:51:20 +02:00
project_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
resource_methods_spec.rb Include ubid in Model#inspect for models using ResourceMethods 2024-10-24 08:47:49 -07:00
spec_helper.rb Parallelize unit tests 2024-03-04 10:39:35 +01:00
sshable_spec.rb Support running specs with frozen environment 2024-10-27 13:25:30 -07:00
strand_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
usage_alert_spec.rb Support running specs with frozen environment 2024-10-27 13:25:30 -07:00
vm_host_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
vm_pool_spec.rb Support testing with frozen Database and models 2024-10-28 14:31:00 -07:00
vm_spec.rb Enable standard-60 vm size with 60 vCPUs 2024-05-28 11:13:25 +02:00
vm_storage_volume_spec.rb Enable multiple SPDK installations 2023-11-22 11:39:28 -08:00