Skip to content

Commit

Permalink
fix: trying to add healthchecks instead of waiting for gh actions 🕓
Browse files Browse the repository at this point in the history
  • Loading branch information
signorecello committed Feb 14, 2022
1 parent e035052 commit f061f15
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 20 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/check-PRs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,13 @@ jobs:
docker-compose build
./start-nightfall -g &> ganache-test.log &disown
# waiting for client healthcheck
- uses: cygnetdigital/wait_for_response@v2.0.0
- name: Waiting for client healthcheck
uses: cygnetdigital/wait_for_response@v2.0.0
with:
url: 'http://localhost:8080/'
url: 'http://localhost:8080/healthcheck'
timeout: 2000000 # 2000s that's hopefully enough...
interval: 10000

# waiting for optimist healthcheck
- uses: cygnetdigital/wait_for_response@v2.0.0
with:
url: 'http://localhost:8081/'
timeout: 2000000
interval: 10000

- name: debug logs - after container startup
if: always()
run: cat ganache-test.log
Expand Down
1 change: 0 additions & 1 deletion nightfall-client/src/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ app.use(cors());
app.use(bodyParser.json({ limit: '2mb' }));
app.use(bodyParser.urlencoded({ limit: '2mb', extended: true }));

app.get('/healthcheck', (req, res) => res.sendStatus(200));
app.use('/deposit', deposit);
app.use('/contract-address', getContractAddress);
app.use('/transfer', transfer);
Expand Down
1 change: 1 addition & 0 deletions nightfall-client/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const main = async () => {
}
initialClientSync().then(async () => {
await startEventQueue(queueManager, eventHandlers);
app.get('/healthcheck', (req, res) => res.sendStatus(200));
});
await mongo.connection(config.MONGO_URL); // get a db connection
app.listen(80);
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/protocol/challenger.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chai.use(chaiHttp);
chai.use(chaiAsPromised);

// we need require here to import jsons
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;
const signingKeys = require('../signingKeys.json');
const mnemonics = require('../mnemonics.json');

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/protocol/gas.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ chai.use(chaiHttp);
chai.use(chaiAsPromised);

// we need require here to import jsons
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;
const mnemonics = require('../mnemonics.json');
const signingKeys = require('../signingKeys.json');
const { fee, transferValue } = require('../configs.json');
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/protocol/health-and-contracts.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chai.use(chaiHttp);
chai.use(chaiAsPromised);

// we need require here to import jsons
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;
const mnemonics = require('../mnemonics.json');
const signingKeys = require('../signingKeys.json');

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/protocol/proposer.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ chai.use(chaiHttp);
chai.use(chaiAsPromised);

// we need require here to import jsons
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;

const mnemonics = require('../mnemonics.json');
const signingKeys = require('../signingKeys.json');
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tokens/erc1155.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { expect } = chai;
chai.use(chaiHttp);
chai.use(chaiAsPromised);

const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;

// we need require here to import jsons
const mnemonics = require('../mnemonics.json');
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tokens/erc20.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { expect } = chai;
chai.use(chaiHttp);
chai.use(chaiAsPromised);

const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;

// we need require here to import jsons
const mnemonics = require('../mnemonics.json');
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tokens/erc721.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const require = createRequire(import.meta.url);
const { expect } = chai;
chai.use(chaiHttp);
chai.use(chaiAsPromised);
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const environment = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;

// we need require here to import jsons
const mnemonics = require('../mnemonics.json');
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tokens/index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-unused-vars */
// import * as erc20 from './erc20.test.mjs';
import * as erc20 from './erc20.test.mjs';
import * as erc721 from './erc721.test.mjs';
import * as erc1155 from './erc1155.test.mjs';
2 changes: 1 addition & 1 deletion test/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import rand from '../common-files/utils/crypto/crypto-random.mjs';

const { expect } = chai;
const { WEB3_PROVIDER_OPTIONS } = config;
const ENVIRONMENT = config.ENVIRONMENTS[process.env.ENVIRONMENT];
const ENVIRONMENT = config.ENVIRONMENTS[process.env.ENVIRONMENT] || config.ENVIRONMENTS.localhost;

const USE_INFURA = config.USE_INFURA === 'true';
const USE_ROPSTEN_NODE = config.USE_ROPSTEN_NODE === 'true';
Expand Down

0 comments on commit f061f15

Please sign in to comment.