admin管理员组文章数量:1026989
I have created the following /.github/workflows/testing.yml
file:
name: Linting-And-Testing
on: [push, pull_request]
jobs:
Linting-And-Testing:
name: Linting-And-Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: npm install
- name: Run linting
run: npm run lint
- name: Run tests
run: npm test
The linting part of this file is correctly completed in seconds. However, the testing takes a long time.
When I manually run the tests for the same code on my computer, the tests finish running in seconds. However, on GitHub, they can take 6 hours to run.
The tests running are creating, reading, updating and deleting data from a Realm database.
An example of some of the tests:
describe("table", () => {
let realm;
beforeEach(() => {
realm = new Realm({ "schema": [table] });
});
afterEach(async() => {
realm.write(() => {
realm.deleteAll(); // Clear all data in the database
});
await realm.close(); // Ensure Realm is closed after each test
});
test("Create table", () => {
expect(realm.schema[0].name).toBe("Table");
});
test("Create record in table", () => {
realm.write(() => {
realm.create("Table", { "id": 1, "name": "Name", "notes": "Notes" });
});
const table = realm.objects("Table")[0];
expect(table.id).toBe(1);
expect(table.name).toBe("Name");
expect(table.notes).toBe("Notes");
});
});
I assume the reason is because the tests are running on Ubuntu instead of an Android or iOS device. If this is the reason, how would I be able to run the tests on an Android and iOS device.
I have created the following /.github/workflows/testing.yml
file:
name: Linting-And-Testing
on: [push, pull_request]
jobs:
Linting-And-Testing:
name: Linting-And-Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: npm install
- name: Run linting
run: npm run lint
- name: Run tests
run: npm test
The linting part of this file is correctly completed in seconds. However, the testing takes a long time.
When I manually run the tests for the same code on my computer, the tests finish running in seconds. However, on GitHub, they can take 6 hours to run.
The tests running are creating, reading, updating and deleting data from a Realm database.
An example of some of the tests:
describe("table", () => {
let realm;
beforeEach(() => {
realm = new Realm({ "schema": [table] });
});
afterEach(async() => {
realm.write(() => {
realm.deleteAll(); // Clear all data in the database
});
await realm.close(); // Ensure Realm is closed after each test
});
test("Create table", () => {
expect(realm.schema[0].name).toBe("Table");
});
test("Create record in table", () => {
realm.write(() => {
realm.create("Table", { "id": 1, "name": "Name", "notes": "Notes" });
});
const table = realm.objects("Table")[0];
expect(table.id).toBe(1);
expect(table.name).toBe("Name");
expect(table.notes).toBe("Notes");
});
});
I assume the reason is because the tests are running on Ubuntu instead of an Android or iOS device. If this is the reason, how would I be able to run the tests on an Android and iOS device.
本文标签: testingGitHub tests take a long timeStack Overflow
版权声明:本文标题:testing - GitHub tests take a long time - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745654016a2161488.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论