Skip to content

Commit 1ed3d23

Browse files
fix specs
1 parent e043065 commit 1ed3d23

File tree

3 files changed

+19
-45
lines changed

3 files changed

+19
-45
lines changed

.github/workflows/parallel_ci.yml

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,27 @@
11
name: Parallel CI
22
on:
33
workflow_call:
4-
secrets:
5-
SECRET_KEY_BASE:
6-
required: true
7-
SESSION_ENCRYPTED_COOKIE_SALT:
8-
required: true
9-
JWT_PRIVATE_KEY:
10-
required: true
11-
JWT_PUBLIC_KEY:
12-
required: true
13-
MDS_USERNAME:
14-
required: true
15-
MDS_PASSWORD:
16-
required: true
17-
AWS_REGION:
18-
required: true
19-
AWS_ACCESS_KEY_ID:
20-
required: true
21-
AWS_SECRET_ACCESS_KEY:
22-
required: true
234
jobs:
245
parallel-test:
256
runs-on: ubuntu-latest
267
strategy:
278
fail-fast: true
289
services:
29-
mysql:
30-
image: mysql:8.0.36
31-
env:
32-
MYSQL_DATABASE: datacite
33-
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
10+
memcached:
11+
image: memcached:1.4.31
3412
ports:
35-
- 3306
36-
elasticsearch:
37-
image: opensearchproject/opensearch:2
38-
env:
39-
discovery.type: single-node
40-
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
41-
OPENSEARCH_INITIAL_ADMIN_PASSWORD: AnUnsecurePassword123
42-
DISABLE_SECURITY_PLUGIN: true
43-
http.cors.enabled: true
44-
bootstrap.memory_lock: true
45-
http.cors.allow-origin: "*"
46-
compatibility.override_main_response_version: true
47-
logger.org.opensearch.discovery: "ERROR"
48-
ports:
49-
- 9200
13+
- 11211/udp
5014
env:
51-
LOG_LEVEL: "info"
52-
MYSQL_HOST: "127.0.0.1"
53-
MYSQL_DATABASE: datacite
54-
MYSQL_USER: root
55-
ES_HOST: "localhost:9200"
56-
ELASTIC_PASSWORD: "AnUnsecurePassword123"
15+
MEMCACHE_SERVERS: "localhost:11211"
16+
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
17+
SESSION_ENCRYPTED_COOKIE_SALT: ${{ secrets.SESSION_ENCRYPTED_COOKIE_SALT }}
18+
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
19+
JWT_PUBLIC_KEY: ${{ secrets.JWT_PUBLIC_KEY }}
20+
AWS_REGION: ${{ secrets.AWS_REGION }}
21+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
22+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
STAFF_ADMIN_TOKEN: ${{ secrets.STAFF_ADMIN_TOKEN }}
24+
STAFF_PROFILES_ADMIN_TOKEN: ${{ secrets.STAFF_PROFILES_ADMIN_TOKEN }}
5725
steps:
5826
- name: Checkout Code
5927
uses: actions/checkout@v3

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ gem "elasticsearch-model", "~> 7.2.1", ">= 7.2.1", require: "elasticsearch/model
2121
gem "elasticsearch-rails", "~> 7.2.1", ">= 7.2.1"
2222
gem "elasticsearch-transport", "~> 7.17", ">= 7.17.10"
2323

24+
# This gem will allow us to write tests without the need for a database
25+
gem "activerecord-nulldb-adapter", "~> 1.1", ">= 1.1.1"
26+
2427
group :development, :test do
2528
gem "debug", platforms: [:mri, :windows]
2629
gem "rubocop", require: false

spec/rails_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@
2424
config.infer_spec_type_from_file_location!
2525

2626
config.filter_rails_from_backtrace!
27+
28+
# Use the activerecord-nulldb-adapter to skip db dependency for specs
29+
ActiveRecord::establish_connection(adapter: :nulldb)
2730
end

0 commit comments

Comments
 (0)