mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-03 19:36:20 +00:00 
			
		
		
		
	Fix test and upgrade github workflows
This commit is contained in:
		
							parent
							
								
									f18cf15894
								
							
						
					
					
						commit
						4eea2b1569
					
				
							
								
								
									
										16
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							@ -73,7 +73,7 @@ jobs:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    services:
 | 
			
		||||
      postgres:
 | 
			
		||||
        # Docker Hub image
 | 
			
		||||
@ -109,7 +109,7 @@ jobs:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    services:
 | 
			
		||||
      mysql:
 | 
			
		||||
        image: mysql
 | 
			
		||||
@ -140,11 +140,11 @@ jobs:
 | 
			
		||||
  e2e_ce_mysql_5:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    needs: [lint, unit_back, unit_front]
 | 
			
		||||
    name: '[CE] E2E (mysql, node: ${{ matrix.node }})'
 | 
			
		||||
    name: '[CE] E2E (mysql:5 , node: ${{ matrix.node }})'
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    services:
 | 
			
		||||
      mysql:
 | 
			
		||||
        image: mysql:5
 | 
			
		||||
@ -179,7 +179,7 @@ jobs:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v2
 | 
			
		||||
      - uses: actions/setup-node@v2-beta
 | 
			
		||||
@ -201,7 +201,7 @@ jobs:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    services:
 | 
			
		||||
      postgres:
 | 
			
		||||
        # Docker Hub image
 | 
			
		||||
@ -241,7 +241,7 @@ jobs:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    services:
 | 
			
		||||
      mysql:
 | 
			
		||||
        image: mysql
 | 
			
		||||
@ -280,7 +280,7 @@ jobs:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node: [12, 14, 16]
 | 
			
		||||
      max-parallel: 2
 | 
			
		||||
      max-parallel: 3
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v2
 | 
			
		||||
      - uses: actions/setup-node@v2-beta
 | 
			
		||||
 | 
			
		||||
@ -4,6 +4,7 @@ const sqlite = {
 | 
			
		||||
    filename: '.tmp/data.db',
 | 
			
		||||
  },
 | 
			
		||||
  useNullAsDefault: true,
 | 
			
		||||
  debug: true,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const postgres = {
 | 
			
		||||
 | 
			
		||||
@ -50,7 +50,6 @@ const toStrapiType = column => {
 | 
			
		||||
    case 'time': {
 | 
			
		||||
      return { type: 'time', args: [{ precision: 3 }] };
 | 
			
		||||
    }
 | 
			
		||||
    // TODO: enum
 | 
			
		||||
    default: {
 | 
			
		||||
      return { type: 'specificType', args: [column.data_type] };
 | 
			
		||||
    }
 | 
			
		||||
@ -107,26 +106,16 @@ class SqliteSchemaInspector {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async getIndexes(tableName) {
 | 
			
		||||
    // const cols = await this.db.connection.raw(SQL_QUERIES.TABLE_INFO, [tableName]);
 | 
			
		||||
    const indexes = await this.db.connection.raw(SQL_QUERIES.INDEX_LIST, [tableName]);
 | 
			
		||||
 | 
			
		||||
    const ret = [];
 | 
			
		||||
 | 
			
		||||
    // for (const col of cols.filter(c => c.pk)) {
 | 
			
		||||
    //   ret.push({
 | 
			
		||||
    //     columns: [col.name],
 | 
			
		||||
    //     type: 'primary',
 | 
			
		||||
    //   });
 | 
			
		||||
    // }
 | 
			
		||||
    // merge pk together
 | 
			
		||||
 | 
			
		||||
    for (const index of indexes.filter(index => !index.name.startsWith('sqlite_'))) {
 | 
			
		||||
      const res = await this.db.connection.raw(SQL_QUERIES.INDEX_INFO, [index.name]);
 | 
			
		||||
 | 
			
		||||
      ret.push({
 | 
			
		||||
        columns: res.map(row => row.name),
 | 
			
		||||
        name: index.name,
 | 
			
		||||
        // TODO: find other index types
 | 
			
		||||
        type: index.unique ? 'unique' : null,
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -228,7 +228,12 @@ describe('Non repeatable and required component', () => {
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      expect(updateRes.statusCode).toBe(200);
 | 
			
		||||
      expect(updateRes.body.data).toMatchObject(res.body.data);
 | 
			
		||||
      expect(updateRes.body.data).toMatchObject({
 | 
			
		||||
        id: res.body.data.id,
 | 
			
		||||
        attributes: {
 | 
			
		||||
          field: res.body.data.attributes.field,
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      const getRes = await rq.get(`/${res.body.data.id}`, {
 | 
			
		||||
        qs: {
 | 
			
		||||
@ -237,7 +242,12 @@ describe('Non repeatable and required component', () => {
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      expect(getRes.statusCode).toBe(200);
 | 
			
		||||
      expect(getRes.body.data).toMatchObject(res.body.data);
 | 
			
		||||
      expect(getRes.body.data).toMatchObject({
 | 
			
		||||
        id: res.body.data.id,
 | 
			
		||||
        attributes: {
 | 
			
		||||
          field: res.body.data.attributes.field,
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    test('Throws if component is null', async () => {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user