Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit fed79f8

Browse files
author
jwngr
committed
Remove need for service account to run tests
1 parent 3785497 commit fed79f8

File tree

8 files changed

+11
-52
lines changed

8 files changed

+11
-52
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,6 @@ $ npm install # install local npm build / test dependencies
8484
$ grunt install # install Selenium server for end-to-end tests
8585
```
8686

87-
### Create a Firebase Project
88-
89-
1. Create a Firebase project [here](https://console.firebase.google.com).
90-
2. Set the `ANGULARFIRE_TEST_DB_URL` environment variable to your project's database URL:
91-
92-
```bash
93-
$ export ANGULARFIRE_TEST_DB_URL="https://<YOUR-DATABASE-NAME>.firebaseio.com"
94-
```
95-
96-
3. Update the entire `config` variable in [`tests/initialize.js`](/tests/initialize.js) to
97-
correspond to your Firebase project. You can find your `apiKey` and `databaseUrl` by clicking the
98-
**Web Setup** button at `https://console.firebase.google.com/project/<projectId>/authentication/users`.
99-
100-
### Download a Service Account JSON File
101-
102-
1. Follow the instructions [here](https://firebase.google.com/docs/server/setup#add_firebase_to_your_app)
103-
on how to create a service account for your project and furnish a private key.
104-
2. Copy the credentials JSON file to `tests/key.json`.
105-
10687
### Lint, Build, and Test
10788

10889
```bash

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ bower_components/
44
tests/coverage/
55

66
.idea
7-
tests/key.json

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ sudo: false
55
addons:
66
sauce_connect: true
77
before_install:
8-
- openssl aes-256-cbc -K $encrypted_d1b4272f4052_key -iv $encrypted_d1b4272f4052_iv
9-
-in tests/key.json.enc -out tests/key.json -d
108
- export CHROME_BIN=chromium-browser
119
- export DISPLAY=:99.0
1210
- sh -e /etc/init.d/xvfb start
@@ -18,12 +16,9 @@ install:
1816
before_script:
1917
- grunt install
2018
- phantomjs --version
21-
script:
22-
- '[ -e tests/key.json ] && sh ./tests/travis.sh || false'
2319
after_script:
2420
- cat ./tests/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
2521
env:
2622
global:
27-
- ANGULARFIRE_TEST_DB_URL=https://angularfire-dae2e.firebaseio.com
2823
- secure: mGHp1rQI11OvbBQn3PnBT5kuyo26gFl8U+nNq0Ot4opgSBX9JaHqS8Dx63uALWWU9qjy08/Mn68t/sKhayH1+XrPDIenOy/XEkkSAG60qAAowD9dRo3WaIMSOcWWYDeqdZOAWZ3LiXvjLO4Swagz5ejz7UtY/ws4CcTi2n/fp7c=
2924
- secure: Eao+hPFWKrHb7qUGEzLg7zdTCE//gb3arf5UmI9Z3i+DydSu/AwExXuywJYUj4/JNm/z8zyJ3j1/mdTyyt9VVyrnQNnyGH1b2oCUHkrs1NLwh5Oe4YcqUYROzoEKdDInvmjVJnIfUEM07htGMGvsLsX4MW2tqVHvD2rOwkn8C9s=

tests/initialize-node.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
var path = require('path');
22
var firebase = require('firebase');
33

4-
if (!process.env.ANGULARFIRE_TEST_DB_URL) {
5-
throw new Error('You need to set the ANGULARFIRE_TEST_DB_URL environment variable.');
6-
}
7-
8-
try {
9-
firebase.initializeApp({
10-
databaseURL: process.env.ANGULARFIRE_TEST_DB_URL
11-
});
12-
} catch (err) {
13-
console.log('Failed to initialize the Firebase SDK [Node]:', err);
14-
}
4+
firebase.initializeApp({
5+
databaseURL: 'https://oss-test.firebaseio.com'
6+
});

tests/initialize.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ if (window.jamsine) {
22
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
33
}
44

5-
try {
6-
// TODO: stop hard-coding this
7-
var config = {
8-
apiKey: "AIzaSyCcB9Ozrh1M-WzrwrSMB6t5y1flL8yXYmY",
9-
authDomain: "angularfire-dae2e.firebaseapp.com",
10-
databaseURL: "https://angularfire-dae2e.firebaseio.com"
11-
};
12-
firebase.initializeApp(config);
13-
} catch (err) {
14-
console.log('Failed to initialize the Firebase SDK [web]:', err);
15-
}
5+
var config = {
6+
apiKey: 'AIzaSyC3eBV8N95k_K67GTfPqf67Mk1P-IKcYng',
7+
authDomain: 'oss-test.firebaseapp.com',
8+
databaseURL: 'https://oss-test.firebaseio.com',
9+
storageBucket: 'oss-test.appspot.com'
10+
};
11+
firebase.initializeApp(config);

tests/key.json.enc

-2.3 KB
Binary file not shown.

tests/unit/FirebaseAuthService.spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
'use strict';
22
describe('$firebaseAuthService', function () {
3-
var $firebaseRefProvider;
4-
var URL = 'https://angularfire-dae2e.firebaseio.com'
5-
63
beforeEach(function () {
74
module('firebase.auth')
85
});

tests/unit/firebaseRef.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
describe('firebaseRef', function () {
33

44
var $firebaseRefProvider;
5-
//TODO: Load this from env
6-
var MOCK_URL = 'https://angularfire-dae2e.firebaseio.com'
5+
var MOCK_URL = 'https://oss-test.firebaseio.com';
76

87
beforeEach(module('firebase.database', function(_$firebaseRefProvider_) {
98
$firebaseRefProvider = _$firebaseRefProvider_;

0 commit comments

Comments
 (0)